Generation

generate functionFri, 06 Dec 2024

selfbot with fun commands for discord

Here's a basic selfbot for Discord in JavaScript with some fun commands. Please note that selfbots are against Discord's terms of service and may get your account banned. **Important:** Before running this code, make sure to install the required packages by running `npm install discord.js` in your terminal. ```javascript // Import required packages const Discord = require('discord.js'); const client = new Discord.Client(); // Set your bot's token (get it from the Discord Developer Portal) const token = 'YOUR_BOT_TOKEN'; // Set up the client client.on('ready', () => { console.log('Bot is online!'); }); // Fun commands client.on('message', (message) => { if (message.author.bot) return; // !hello command if (message.content.startsWith('!hello')) { message.channel.send('Hello!'); } // !goodbye command if (message.content.startsWith('!goodbye')) { message.channel.send('Goodbye!'); } // !roll command if (message.content.startsWith('!roll')) { const roll = Math.floor(Math.random() * 100); message.channel.send(`You rolled a ${roll}!`); } // !joke command if (message.content.startsWith('!joke')) { const jokes = [ 'Why don\'t scientists trust atoms? Because they make up everything!', 'Why don\'t eggs tell jokes? They\'d crack each other up!', 'Why did the tomato turn red? Because it saw the salad dressing!', ]; const joke = jokes[Math.floor(Math.random() * jokes.length)]; message.channel.send(joke); } // !ping command if (message.content.startsWith('!ping')) { message.channel.send('Pong!'); } // !say command if (message.content.startsWith('!say')) { const args = message.content.split(' '); if (args.length > 1) { const text = args.slice(1).join(' '); message.channel.send(text); } else { message.channel.send('Please provide some text to say!'); } } // !8ball command if (message.content.startsWith('!8ball')) { const args = message.content.split(' '); if (args.length > 1) { const question = args.slice(1).join(' '); const answers = [ 'It is certain', 'It is decidedly so', 'Without a doubt', 'Yes definitely', 'You may rely on it', 'As I see it, yes', 'Most likely', 'Outlook good', 'Yes', 'Signs point to yes', 'Reply hazy try again', 'Ask again later', 'Better not tell you now', 'Cannot predict now', 'Concentrate and ask again', 'Don\'t count on it', 'My reply is no', 'My sources say no', 'Outlook not so good', 'Very doubtful', ]; const answer = answers[Math.floor(Math.random() * answers.length)]; message.channel.send(`**8ball:** ${answer}`); } else { message.channel.send('Please provide a question!'); } } }); // Login to Discord client.login(token); ``` **Commands:** * `!hello`: Sends a "Hello!" message. * `!goodbye`: Sends a "Goodbye!" message. * `!roll`: Rolls a random number between 1 and 100. * `!joke`: Sends a random joke. * `!ping`: Sends a "Pong!" message. * `!say <text>`: Repeats the provided text. * `!8ball <question>`: Answers a question with a random response from a magic 8-ball. **Note:** This is a basic selfbot and you can add more commands and features as per your requirements. Also, make sure to replace `YOUR_BOT_TOKEN` with your actual bot token from the Discord Developer Portal.

Javascript
Generate More

Questions about programming?Chat with your personal AI assistant