【发布时间】:2021-08-22 04:54:13
【问题描述】:
当我在 Visual Studio Code 上运行机器人并且它正常运行时,所有其他命令,但是当我尝试运行这个 ship 命令时没有任何反应,我的机器人没有发送任何内容,VS Code 也没有向我发送任何错误.
const Discord = require('discord.js');
require('discord-reply');
const getMember = require('functions.js')
const bot = new Discord.Client();
bot.on('ready', () => {
console.log('hello mother')
bot.user.setActivity('bia info')
});
module.exports.run = async (bot, message, args, prefix) => {
bot.on('message', (message) => {
if (message.content == 'bia ship') {
let user = message.mentions.users.first()
let RN = Math.floor(Math.random() * 100)
const UnLoveEmbed = new Discord.MessageEmbed()
.setColor('#A14EFF')
.setTitle('Uhm.. There is not a match. ???? ????')
.setDescription(`'${message.author} shipped with ${user} gives ${RN}%'`)
const LoveEmbed = new Discord.MessageEmbed()
.setColor('#A14EFF')
.setTitle('Looks like we have a couple here! ???? ????')
.setDescription(`${message.author} shipped with ${user} gives ${RN}%`)
if (RN > 50) {
message.channel.send(LoveEmbed)
} else {
if (RN < 50) {
message.channel.send(UnLoveEmbed)
}
}
}}
)};
【问题讨论】:
标签: javascript node.js discord.js