const Discord = require('discord.js');
const client = new Discord.Client();
const talkedRecently = new Set();
client.on('ready', () => {
console.log("Bot is ready!!");
});
client.on('message', message => {
if (message.author.id != client.user.id) {
if (talkedRecently.has(message.author.id)) {
} else {
message.author.send('Yo');
talkedRecently.add(message.author.id);
setTimeout(() => {talkedRecently.delete(message.author.id);}, 1800000);
}
}
});
client.login(<TOKEN>)
此源代码与令牌机器人正常工作我想使用个人帐户令牌登录我应该使用或做什么?
他们在 v12 中从 discord.js 中删除了对用户令牌(self bot)的支持,并查看了 commit 他们从包中删除了很多内容。
在对 discord.js 包进行了一些研究之后,找到了一种可以通过做来覆盖此功能的方法。
这将在调用不和谐网关时删除前缀
bot
并且客户端将成功连接。这纯粹是为了教育目的,应该负责任地使用。
P.s 他们还将在 apis 中修改一些其他的东西以使其成为不可能。