Hey i was making a crypto price bot but it doesnt let me send a embed can someone check my code if i made any mistakes? i have tried alot of diffrent things but nothing seems to work not even chaning channel permissions There might be a error in my code i dont know if there is anyone that can help please help me pls
const Discord = require("discord.js")
const client = new Discord.Client()
const mySecret = process.env['TOKEN']
const CoinGecko = require('coingecko-api');
const CoinGeckoClient = new CoinGecko();
const { MessageEmbed } = require('discord.js');
client.on("ready", () => {
console.log(`------`)
console.log(`Succesfull login as ${client.user.tag}`)
console.log(`------`)
client.user.setActivity('Doge Dash price', { type: 'WATCHING' });
})
client.on("message", msg => {
if (msg.content === '$price') {
const exampleEmbed = {
color: 0x0099ff,
title: 'Some title',
url: 'https://discord.js.org',
author: {
name: 'Some name',
icon_url: 'https://i.imgur.com/AfFp7pu.png',
url: 'https://discord.js.org',
},
description: 'Some description here',
thumbnail: {
url: 'https://i.imgur.com/AfFp7pu.png',
},
fields: [
{
name: 'Regular field title',
value: 'Some value here',
},
{
name: '\u200b',
value: '\u200b',
inline: false,
},
{
name: 'Inline field title',
value: 'Some value here',
inline: true,
},
{
name: 'Inline field title',
value: 'Some value here',
inline: true,
},
{
name: 'Inline field title',
value: 'Some value here',
inline: true,
},
],
image: {
url: 'https://i.imgur.com/AfFp7pu.png',
},
timestamp: new Date(),
footer: {
text: 'Some footer text here',
icon_url: 'https://i.imgur.com/AfFp7pu.png',
},
};
msg.channel.send({ embeds: [exampleEmbed] });
}
if (msg.content === '$test') {
msg.channel.send("test")
}
})
async function getPrice(msg) {
let data = await CoinGeckoClient.simple.price({
ids: ['doge-dash'],
vs_currencies: ['eur', 'usd'],
});
string(data)
msg.reply(data)
}
client.login(mySecret)