admin管理员组文章数量:1332377
OK so before I get 500 ments about self bots being against TOS I already know that and I am ready to accept the risk. So I have made other selfbots about 3-4 years ago before most libraries stopped supporting it and I would like to know is there a way I can make this code to accept a user token and log in?
const { Client } = require("discord.js");
const client = new Client({
disableEveryone: true
});
const config = require("./config.json");
var prefix = config.prefix;
client.on('ready', () => {
console.log(`Logged in as ${client.user.tag}!`);
});
client.on('message', msg => {
if(msg.author !== client.user) return;
if (msg.content.startsWith(prefix + 'bump')) {
msg.delete()
msg.channel.send(`**hello `)
}
OK so before I get 500 ments about self bots being against TOS I already know that and I am ready to accept the risk. So I have made other selfbots about 3-4 years ago before most libraries stopped supporting it and I would like to know is there a way I can make this code to accept a user token and log in?
const { Client } = require("discord.js");
const client = new Client({
disableEveryone: true
});
const config = require("./config.json");
var prefix = config.prefix;
client.on('ready', () => {
console.log(`Logged in as ${client.user.tag}!`);
});
client.on('message', msg => {
if(msg.author !== client.user) return;
if (msg.content.startsWith(prefix + 'bump')) {
msg.delete()
msg.channel.send(`**hello `)
}
Share
Improve this question
edited Mar 28, 2020 at 17:44
haldo
16.7k8 gold badges55 silver badges59 bronze badges
asked Mar 28, 2020 at 17:30
bellamybellamy
11 gold badge1 silver badge1 bronze badge
4 Answers
Reset to default 2If you're using chrome you can open up the developer tools, go to the network tab, filter by "XHR", reload the page, find the request to /api/v6/gateway or any other url under /api, then look at the headers and find the authorization header to get your token. Then, use the token as normal.
Instead of using discord.js just do
npm i discord.js-selfbot
Which is just like discord.js v12 but that allows the use of selfbots.
As with many discord.js answers, they are deprecated with version 12. Since v12 removed support for selfbots, try the npm package discord.js-self
. It works exactly like discord.js, except it only supports logging in using a normal account's authorization token.
Self-bots where removed in v12.
To install the latest v11 release, use the following mand:
yarn add discord.js@11
The problem with using other packages is that typings may not be available, while they work when using the official package.
本文标签: javascriptDISCORD selfbot in JSStack Overflow
版权声明:本文标题:javascript - DISCORD selfbot in JS - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742306250a2449976.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论