First push

This commit is contained in:
Wizzard 2024-02-05 18:58:56 -05:00
commit e851b7d169
3 changed files with 34 additions and 0 deletions

1
EXAMPLE.env Normal file
View File

@ -0,0 +1 @@
DISCORD_TOKEN=MAOISYHRO9

27
main.js Normal file
View File

@ -0,0 +1,27 @@
require('dotenv').config();
const { Client } = require('discord.js-selfbot-v13');
const client = new Client();
client.on('ready', () => {
console.log(`Logged in as ${client.user.tag}!`);
});
client.on('messageCreate', async message => {
if (message.author.id !== client.user.id) return;
if (message.content.startsWith('.delete')) {
const args = message.content.split(' ').slice(1);
const deleteCount = parseInt(args[0], 10);
if (!isNaN(deleteCount)) {
const messages = await message.channel.messages.fetch({ limit: deleteCount + 1 });
const filtered = messages.filter(msg => msg.author.id === client.user.id);
filtered.forEach(msg => msg.delete().catch(console.error));
}
} else if (message.content === '.help') {
message.channel.send('`.delete [number]` - Deletes a specified number of your messages.\n`.help` - Shows this help message.');
}
});
client.login(process.env.DISCORD_TOKEN);

6
package.json Normal file
View File

@ -0,0 +1,6 @@
{
"dependencies": {
"discord.js-selfbot-v13": "^3.1.4",
"dotenv": "^16.4.1"
}
}