我有这段代码可以在您键入时更改我的机器人的状态!status <status>并且它工作正常,但是当我重新启动我的机器人时,状态重置为我在开始时定义的任何内容,有什么办法可以解决这个问题吗?
client.on('message', message => {
if (message.author.bot) return;
const args = message.content.slice(prefix.length).trim().split(' ');
const command = args.shift().toLowerCase();
const text = args.join(' ');
if (command === 'status') {
if (!args.length) {
return message.channel.send(`Please tell the bot what to say, ${message.author}`);
}
client.user.setActivity(text, { //write msg here
type: "WATCHING", //LISTENING or PLAYING
name: "itt"
});
message.channel.send('Changed status to ' + text)
}
});
慕桂英546537
相关分类