Skip to content

Instantly share code, notes, and snippets.

@VillainsRule
Created December 17, 2023 11:54
Show Gist options
  • Save VillainsRule/75e3aaa512bf0c2ec8484b1882636ceb to your computer and use it in GitHub Desktop.
Save VillainsRule/75e3aaa512bf0c2ec8484b1882636ceb to your computer and use it in GitHub Desktop.

Mockery

Mockery is a selfbot that mocks people on Discord.

Setup

  1. Copy script.js and package.json (below) into a new directory.
  2. Create a file named token.txt and paste a Discord account token inside.
  3. Make sure Node and NPM are installed, and then run npm i in the script's directory.
  4. Once npm i has completed, run npm run dev.

That's it! You're mocking people!

Commands

The prefix is `pls`.
  • pls pause - pauses the bot
  • pls unpause - unpauses the bot
  • pls mock <mention a user> - starts mocking a user
  • pls ignore <mention a user> - stops mocking a user
  • pls list - unstable command to list people being mocked
  • pls sudo <mention a user> - gives a user ability to run the above 5 commands
  • pls kill <mention a user> - removes their ability to sudo

To add the first sudo, add your user ID in data/sudo.json. It would look something like this: ["IDHERE"]. Don't worry if you don't see that file originally, it'll be created when you first run the script. After you make any manual changes to files in the data directory, restart the script.

made with ❤️ by xthonk
{
"main": "script.js",
"type": "module",
"scripts": {
"dev": "nodemon -e '.js'"
},
"dependencies": {
"discord.js-selfbot-v13": "^2.15.0",
"nodemon": "^3.0.2"
}
}
if (!fs.existsSync('./data')) fs.mkdirSync('./data');
if (!fs.existsSync('./data/mocked.json')) fs.appendFileSync('./data/mocked.json', '[]');
if (!fs.existsSync('./data/sudo.json')) fs.appendFileSync('./data/sudo.json', '[]');
import * as self from 'discord.js-selfbot-v13';
import fs from 'fs';
let client = new self.Client({
checkUpdate: false
});
let paused = false;
let toMock = JSON.parse(fs.readFileSync('./data/mocked.json', 'utf-8'));
let sudo = JSON.parse(fs.readFileSync('./data/sudo.json', 'utf-8'));
let mock = (input) => {
let output = '';
for (let i = 0; i < input.length; i++) output += i % 2 ? input[i].toUpperCase() : input[i].toLowerCase();
return output;
};
let chunk = (array, chunkSize) => {
const result = [];
for (let i = 0; i < array.length; i += chunkSize) {
const chunk = array.slice(i, i + chunkSize);
result.push(chunk);
};
return result;
};
client.on('ready', () => console.log('Logged in as ' + client.user.tag + '!'));
client.on('messageCreate', (m) => {
if (paused) return;
if (toMock.includes(m.author.id)) m.channel.send(mock(m.content)).catch(e => {});
if (!sudo.includes(m.author.id)) return;
if (!m.content.startsWith('pls ')) return;
let cmd = m.content.split(' ')[1];
switch(cmd) {
case 'pause':
paused = true;
break;
case 'unpause':
paused = false;
break;
case 'mock':
if (!m.mentions.users.first()) return;
if (m.mentions.users.first().id === client.user.id) return;
toMock.push(m.mentions.users.first().id);
fs.writeFileSync('./data/mocked.json', JSON.stringify(toMock, null, 4));
break;
case 'ignore':
if (!m.mentions.users.first()) return;
toMock = toMock.filter(id => id !== m.mentions.users.first().id);
fs.writeFileSync('./data/mocked.json', JSON.stringify(toMock, null, 4));
break;
case 'list':
m.channel.send(`**mocking:**`);
chunk(toMock, 4).forEach(chunk => m.channel.send(`- <@${chunk.join('> \n- <@')}>`));
m.channel.send(`**sudo:** <@${sudo.join('>, <@')}>`);
break;
case 'sudo':
if (!m.mentions.users.first()) return;
sudo.push(m.mentions.users.first().id);
fs.writeFileSync('./data/sudo.json', JSON.stringify(sudo, null, 4));
break;
case 'kill':
if (!m.mentions.users.first()) return;
sudo = sudo.filter(id => id !== m.mentions.users.first().id);
fs.writeFileSync('./data/sudo.json', JSON.stringify(sudo, null, 4));
break;
case 'leave':
m.guild.leave();
break;
};
});
client.login(fs.readFileSync('token.txt', 'utf-8'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment