Advertisement
Guest User

Untitled

a guest
Jan 24th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 4.88 KB | None | 0 0
  1. using Discord;
  2. using Discord.Commands;
  3.  
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9.  
  10. namespace Discord_Bot
  11. {
  12.     class MyBot
  13.     {
  14.         DiscordClient discord;
  15.         CommandService commands;
  16.  
  17.         Random rand;
  18.  
  19.         string[] reactionMemes;
  20.  
  21.         string[] roastSomeone;
  22.  
  23.         public MyBot()
  24.         {
  25.             rand = new Random();
  26.  
  27.             reactionMemes = new string[]
  28.             {
  29.                 "mems/2thumbs.jpg", // 0
  30.                 "mems/angery.jpg", // 1
  31.                 "mems/chuck.jpg", // 2
  32.                 "mems/hous.gif", // 3
  33.                 "mems/fukdoge.jpg", // 4
  34.                 "mems/mrrick.jpg", // 5
  35.                 "mems/nikita.png", // 6
  36.                 "mems/unnamed.jpg", // 7
  37.  
  38.             };
  39.  
  40.             roastSomeone = new string[]
  41.             {
  42.                 "You'll never be the man your mother is.",
  43.                 "You're a failed abortion whose birth certificate is an apology from the condom factory",
  44.                 "You must have been born on a highway, because that's where most accidents happen",
  45.                 "It looks like your face caught on fire and someone tried to put it out with a fork",
  46.                 "You're so fucking fat, bro. How were YOU the fastest out of 100,000 sperm?",
  47.                 "Unless thats the sound of your body being dragged away, i dont wanna hear it",
  48.                 "Feel free to blow my asshole, you dirty shit.",
  49.                 "Your purposeless existence makes me want to drown puppies.",
  50.                 "You are disfigured and you smell like rectum relish.",
  51.                 "You have cholera. Don't cry however, it's not the worst thing that could happen. You're also going to die from it.",
  52.                 "I will kill you if you don't just stop being an insignificant cunt for at least the next 10 minutes..",
  53.                 "I often like to take a bath and picture you being murdered.",
  54.                 "Tonight I will take a giant juicy shit in the tank of your toilet.",
  55.                 "Hey thickness, I find your fat little fingers appalling.",
  56.                 "You're very nice. And by nice I really mean repelling.",
  57.                 "I pray that you get anal boils.",
  58.                 "There are rumors that your turn-ons consist of mommy touching and feces.",
  59.                 "Why the fuck do you smell so fucking nasty, did you play in the dumpster again?",
  60.                 "Nigga",
  61.                 "You will never have sex.",
  62.                 "You have an average sized penis",
  63.  
  64.  
  65.             };
  66.  
  67.             discord = new DiscordClient(x =>
  68.             {
  69.                 x.LogLevel = LogSeverity.Info;
  70.                 x.LogHandler = Log;
  71.             });
  72.  
  73.             discord.UsingCommands(x =>
  74.             {
  75.                 x.PrefixChar = '!';
  76.                 x.AllowMentionPrefix = true;
  77.             });
  78.  
  79.             commands = discord.GetService<CommandService>();
  80.  
  81.             RegisterMemeCommand();
  82.             RoastSomeoneCommand();
  83.             RegisterSweepCommand();
  84.             AinsleyMemeCommand();
  85.  
  86.             discord.ExecuteAndWait(async () =>
  87.             {
  88.             await discord.Connect(“kek”, TokenType.Bot);
  89.             });
  90.         }
  91.  
  92.         private void RegisterMemeCommand()
  93.         {
  94.             commands.CreateCommand("react")
  95.                 .Do(async(e) =>
  96.                 {
  97.                     int RandomMemeIndex = rand.Next(reactionMemes.Length);
  98.                     string MemeToPost = reactionMemes[RandomMemeIndex];
  99.                     await e.Channel.SendFile(MemeToPost);
  100.                 });
  101.         }
  102.  
  103.         private void AinsleyMemeCommand()
  104.         {
  105.             commands.CreateCommand("chuck")
  106.                 .Do(async (e) =>
  107.                 {
  108.                     string MemeToPost = "mems/chuck.jpg";
  109.                     await e.Channel.SendFile(MemeToPost);
  110.                 });
  111.         }
  112.  
  113.         private void RoastSomeoneCommand()
  114.         {
  115.             commands.CreateCommand("roast")
  116.                 .Do(async (e) =>
  117.                 {
  118.                     int RandomRoastIndex = rand.Next(roastSomeone.Length);
  119.                     string roastSomeoneCommand = roastSomeone[RandomRoastIndex];
  120.                     await e.Channel.SendMessage(roastSomeoneCommand);
  121.                 });
  122.         }
  123.  
  124.         private void RegisterSweepCommand()
  125.         {
  126.             commands.CreateCommand("sweep")
  127.                 .Do(async (e) =>
  128.                 {
  129.                     Message[] MessagesToDelete;
  130.                     MessagesToDelete = await e.Channel.DownloadMessages(100);
  131.  
  132.                     await e.Channel.DeleteMessages(MessagesToDelete);
  133.                });
  134.         }
  135.  
  136.  
  137.  
  138.  
  139.         private void Log(object sender, LogMessageEventArgs e)
  140.         {
  141.             Console.WriteLine(e.Message);
  142.  
  143.          }
  144.       }
  145. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement