Oye, estaba haciendo un bot de precio criptográfico, pero no me permite enviar una inserción. ¿Alguien puede verificar mi código si cometí algún error? He intentado muchas cosas diferentes, pero nada parece funcionar, ni siquiera cambiar los permisos del canal. Puede haber un error en mi código. No sé si hay alguien que pueda ayudar. Por favor, ayúdame, por favor.
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)