[英]Discord.js messaging errors
I've been recently working on my second Discord.JS bot.我最近一直在研究我的第二个 Discord.JS 机器人。 I coded some basics and tested it.
我编写了一些基础知识并对其进行了测试。 However, when I use the
.verify
command, it didn't make any reactions.但是,当我使用
.verify
命令时,它没有任何反应。 Please help!请帮忙!
const { Client, Intents } = require('discord.js');
const client = new Client({ intents: [Intents.FLAGS.GUILDS] });
const { token } = require('./config.json');
const prefix = "."
client.on("ready", () => { console.log(`Logged in as ${client.user.tag}!`) })
client.on('message', message => {
if (message.content.startsWith(`${prefix}verify`)) {
message.channel.send('SUCCESFULLY VERIFIED');
}
})
client.login(token);
https://discord.js.org/#/docs/main/stable/class/Client?scrollTo=e-message https://discord.js.org/#/docs/main/stable/class/Client?scrollTo=e-message
I hope this answers your question我希望这回答了你的问题
maybe after message.channel.send('SUCCESFULLY VERIFIED')
put .catch(console.error)
也许在
message.channel.send('SUCCESFULLY VERIFIED')
之后放置.catch(console.error)
const { Client, Intents } = require('discord.js');
const client = new Client({ intents: [Intents.FLAGS.GUILDS] });
const { token } = require('./config.json');
const prefix = "."
client.on("ready", () => { console.log(`Logged in as ${client.user.tag}!`) })
client.on('message', message => {
if (message.content.startsWith(`${prefix}verify`)) {
message.channel.send('SUCCESFULLY VERIFIED').catch(console.error)
}
})
client.login(token);
actually we can't do anythink because you don't send the error实际上我们无能为力因为你没有发送错误
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.