refactor: vendor content as regular files (remove git submodules) so CI builds don't need GitHub auth
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
'use strict';
|
||||
|
||||
// No longer using 2captcha since the website no longer supports hCaptcha, which Discord uses.
|
||||
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);
|
||||
},
|
||||
TOTPKey: '<string>',
|
||||
});
|
||||
|
||||
client.on('ready', async () => {
|
||||
console.log('Ready!', client.user.tag);
|
||||
// Note
|
||||
// You need to include `guild_id` to invite the bot
|
||||
// These two fields can appear either in the URL or in the options.
|
||||
await client.authorizeURL(
|
||||
`https://discord.com/api/oauth2/authorize?client_id=289066747443675143&permissions=414501424448&scope=bot%20applications.commands`,
|
||||
{
|
||||
guild_id: 'guild id',
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
client.login('token');
|
||||
Reference in New Issue
Block a user