chore: example AddBot
This commit is contained in:
parent
cb67f34b64
commit
82e4dca3e5
@ -14,7 +14,8 @@
|
|||||||
"node": true
|
"node": true
|
||||||
},
|
},
|
||||||
"ignorePatterns": [
|
"ignorePatterns": [
|
||||||
"**/src/util/Voice.js"
|
"**/src/util/Voice.js",
|
||||||
|
"**/examples/**"
|
||||||
],
|
],
|
||||||
"rules": {
|
"rules": {
|
||||||
"import/order": [
|
"import/order": [
|
||||||
|
32
examples/AddBot.js
Normal file
32
examples/AddBot.js
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
const Captcha = require('2captcha');
|
||||||
|
const Discord = require('../src/index');
|
||||||
|
|
||||||
|
const solver = new Captcha.Solver('<2captcha key>');
|
||||||
|
|
||||||
|
const client = new Discord.Client({
|
||||||
|
captchaSolver: function (captcha, UA) {
|
||||||
|
return solver
|
||||||
|
.hcaptcha(captcha.captcha_sitekey, 'discord.com', {
|
||||||
|
invisible: 1,
|
||||||
|
userAgent: UA,
|
||||||
|
data: captcha.captcha_rqdata,
|
||||||
|
})
|
||||||
|
.then(res => res.data);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
client.on('ready', async () => {
|
||||||
|
console.log('Ready!', client.user.tag);
|
||||||
|
await client.authorizeURL(
|
||||||
|
`https://discord.com/api/oauth2/authorize?client_id=289066747443675143&permissions=414501424448&scope=bot%20applications.commands`,
|
||||||
|
{
|
||||||
|
guild_id: 'guild id',
|
||||||
|
permissions: '8', // Admin
|
||||||
|
authorize: true,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
client.login('token');
|
Loading…
Reference in New Issue
Block a user