Advertisement
AndiGodGamersDev

Messy Bot Code

Dec 16th, 2023 (edited)
545
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JavaScript 4.50 KB | Source Code | 0 0
  1. require('dotenv').config();
  2. const Discord = require('discord.js');
  3. const { Client, IntentsBitField, EmbedBuilder } = Discord;
  4.  
  5. const PoopyClient = new Client({
  6.   fetchAllMembers: true,
  7.   disableEveryone: false,
  8.   intents: [
  9.     IntentsBitField.Flags.Guilds,
  10.     IntentsBitField.Flags.GuildMembers,
  11.     IntentsBitField.Flags.GuildMessages,
  12.     IntentsBitField.Flags.MessageContent,
  13.   ],
  14. });
  15.  
  16. PoopyClient.on('ready', async (member) => { // this event gets sented/alerted when the bot are online and is activated
  17.   console.log(`✅ ${PoopyClient.user.tag} Are Now Online And Its Currenly Being Crazy LMFAO`)
  18.   const CreateEmbed = new EmbedBuilder()
  19.     .setColor('Random')
  20.     .setTitle('Testing')
  21.     .setDescription(`Lmfao`)
  22.     .setTimestamp()
  23.   const Activities_Lists = [
  24.     "MrAndi Is Deving Roblox Game Lmfao",
  25.     "MrAndi Is Currenly Busy With Irl Diabetes Stuff Lmfao",
  26.     "This Poopy Bot Is Still Being Development Lmfao",
  27.     `Channels: ${member.channels.cache.size}`, // Enables the bot to show how many channels it's in, in the status
  28.   ]; // Creates an arraylist containing phrases you want your bot to switch through.
  29.   PoopyClient.channels.cache.get(process.env.DEBUGCHANNELID).send({ embeds: [CreateEmbed] });
  30.   setInterval(() => {
  31.     const ActivitiesIndex = Math.floor(Math.random() * (Activities_Lists.length - 1) + 1); // generates a random number between 1 and the length of the activities array list (in this case 5).
  32.     PoopyClient.user.setActivity(Activities_Lists[ActivitiesIndex]); // sets bot's activities to one of the phrases in the arraylist.
  33.   }, process.env.SECONDS); // Runs this every 15 Or Random Amount Of Seconds.
  34. });
  35.  
  36. PoopyClient.on('messageCreate', async (message) => { //This Event Gets sented/alerted when the bot is sented a message using a command
  37.   const OwnerID = "808718935553736714"
  38.   const Mention = "<@1178833408063971478>"
  39.   const MentionDeveloper = "<@808718935553736714>"
  40.   const ErrorMessage = "One of the emojis failed to react:"
  41.   const Prefix = ">"
  42.   if (message.content === Mention) {
  43.     const CreateEmbed = new EmbedBuilder()
  44.       .setTitle('Command Lists')
  45.       .setColor('Random')
  46.       .setDescription(`>ping, >toilet, >botinfo, >avatar`)
  47.       .setTimestamp()
  48.     return message.channel.send({ embeds: [CreateEmbed] });
  49.   }
  50.   if (message.content.toLowerCase().startsWith(Prefix + 'Ping', Prefix + 'Toilet', Prefix + 'Botinfo', Prefix + 'Avatar', Prefix + 'React'))
  51.     if (message.content === Prefix + 'ping') {
  52.       const CreateEmbed = new EmbedBuilder()
  53.         .setTitle('Ping')
  54.         .setColor('Random')
  55.         .setDescription(`Heres Your Pong ${PoopyClient.ws.ping}: ms`)
  56.         .setTimestamp()
  57.       return message.channel.send({ embeds: [CreateEmbed] });
  58.     }
  59.   if (message.content === Prefix + 'toilet') {
  60.     const CreateEmbed = new EmbedBuilder()
  61.       .setTitle('Your So Skibidi')
  62.       .setColor('Random')
  63.       .setDescription(`i've Just Want To Be Your Sigma`)
  64.      .setTimestamp()
  65.    return message.channel.send({ embeds: [CreateEmbed] });
  66.  }
  67.  if (message.content === Prefix + 'botinfo') {
  68.    const CreateEmbed = new EmbedBuilder()
  69.      .setTitle('If Theres A Bug')
  70.      .setColor('Random')
  71.      .setDescription(`Please Let The Bot Developer Know ${MentionDeveloper}`)
  72.      .setTimestamp()
  73.    return message.channel.send({ embeds: [CreateEmbed] });
  74.  }
  75.  if (message.content === Prefix + 'avatar') {
  76.    const CreateEmbed = new EmbedBuilder()
  77.      .setTitle('Coming Soon')
  78.      .setColor('Random')
  79.      .setDescription('👀')
  80.      .setTimestamp()
  81.    return message.channel.send({ embeds: [CreateEmbed] });
  82.  }
  83.  if (message.content === 'amongus') {
  84.    const ReactEmoji = message.guild.emojis.cache.find(emoji => emoji.name === 'amongus');
  85.    try {
  86.      await message.react(ReactEmoji);
  87.    } catch (error) {
  88.      console.error(ErrorMessage, error);
  89.    }
  90.  }
  91.  if (message.content === 'nerd') {
  92.    const ReactionEmoji = message.guild.emojis.cache.find(emoji => emoji.name === 'Nerdcord_2');
  93.    try {
  94.      await message.react(ReactionEmoji);
  95.    } catch (error) {
  96.      console.error(ErrorMessage, error);
  97.    }
  98.  }
  99.  switch (message.content.toLowerCase()) {
  100.    case Prefix + 'restartbot': {
  101.      if (message.author.id !== OwnerID)
  102.        return;
  103.      message.channel.send('Restarting...').then(m => {
  104.        PoopyClient.destroy().then(() => {
  105.          PoopyClient.login(process.env.BOTTOKEN);
  106.        });
  107.      });
  108.      break;
  109.    }
  110.  }
  111. })
  112.  
  113. PoopyClient.login(process.env.BOTTOKEN)
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement