Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Discord;
- using System;
- using System.Security;
- using System.Text;
- namespace LaurensBot
- {
- class Program
- {
- public static DiscordClient client;
- static void Main(string[] args)
- {
- var login = GetLogin();
- Console.Clear();
- Console.WriteLine("Connecting to server...");
- client = new DiscordClient();
- client.Ready += Client_Ready;
- client.MessageReceived += Client_MessageReceived;
- client.Connect(login.Item1, login.Item2);
- Console.ReadLine();
- }
- private static void Client_Ready(object sender, EventArgs e)
- {
- Console.Clear();
- Console.WriteLine("Bot connected to server!");
- }
- public static Tuple<string, string> GetLogin()
- {
- Console.Write("Email: ");
- var username = Console.ReadLine();
- Console.Write("Password: ");
- var password = GetPassword();
- return new Tuple<string, string>(username, password.ToString());
- }
- public static string GetPassword()
- {
- var pwd = new StringBuilder();
- while (true)
- {
- ConsoleKeyInfo i = Console.ReadKey(true);
- if (i.Key == ConsoleKey.Enter)
- {
- break;
- }
- else if (i.Key == ConsoleKey.Backspace)
- {
- if (pwd.Length > 0)
- {
- pwd.Remove(pwd.Length - 1, 1);
- Console.Write("\b \b");
- }
- }
- else
- {
- pwd.Append(i.KeyChar);
- Console.Write("*");
- }
- }
- return pwd.ToString();
- }
- static string[] insults = new string[] {
- "you smell like a bag of rotten potatoes.",
- "you're almost as gay as jewus",
- "you're so stupid",
- "you have no friends",
- "sorry, I can't hear how annoying you are",
- "you're a failed abortion whose birth certificate is an apology from the condom factory",
- "you must have been born on a highway, because that's where most accidents happen.",
- "your family tree is a cactus, because everybody on it is a prick.",
- "you're so ugly Hello Kitty said goodbye to you.",
- "it looks like your face caught on fire and someone tried to put it out with a fork.",
- "you are so ugly that when your mama dropped you off at school she got a fine for littering.",
- "if you were twice as smart, you'd still be stupid.",
- "do you have to leave so soon? I was just about to poison the tea.",
- "you're so ugly when you popped out the doctor said aww what a treasure and your mom said yeah lets bury it",
- "if your brain was made of chocolate it wouldn't fill an M&M"
- };
- private static void Client_MessageReceived(object sender, MessageEventArgs e)
- {
- if (e.User == null || e.User.IsBot)
- return;
- if (e.Message.Text.StartsWith("+insult ") && e.Message.Text.Length > 8)
- {
- var name = e.Message.Text.Substring(8);
- Random rnd = new Random();
- var insult = insults[rnd.Next(0, insults.Length)];
- e.Channel.SendMessage($"{name}, {insult}");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement