commit e851b7d169241b134d3389208009b3a19dc587d7 Author: Wizzard Date: Mon Feb 5 18:58:56 2024 -0500 First push diff --git a/EXAMPLE.env b/EXAMPLE.env new file mode 100644 index 0000000..b2ed7ee --- /dev/null +++ b/EXAMPLE.env @@ -0,0 +1 @@ +DISCORD_TOKEN=MAOISYHRO9 diff --git a/main.js b/main.js new file mode 100644 index 0000000..d360e12 --- /dev/null +++ b/main.js @@ -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); + diff --git a/package.json b/package.json new file mode 100644 index 0000000..03830d3 --- /dev/null +++ b/package.json @@ -0,0 +1,6 @@ +{ + "dependencies": { + "discord.js-selfbot-v13": "^3.1.4", + "dotenv": "^16.4.1" + } +}