Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Discord.Commands;
- using Discord;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using Discord.Modules;
- /// <summary>
- /// PM PROOFING
- ///
- /// if (e.Channel.IsPrivate == true){ } else { (THE COMMAND HERE) }
- ///
- /// </summary>
- namespace NomBotV2
- {
- class NomBotV2
- {
- DiscordClient discord;
- string x;
- string y;
- string inputa="";
- string inputb="";
- float a;
- float b;
- float c;
- long factora;
- long factorb;
- long factorc;
- string game = "";
- long nom= 204441911489069056;
- int totalscore;
- string rank;
- int score;
- string spamnew="fin";
- string spamold="start";
- new string newuser = "";
- new string olduser = "";
- string censorID;
- // Realm of NomBot Server ID: 299653823503400960
- // Paradox Infinity Server ID: 233717585605033984
- // Nom's Server ID: 254302003188989953
- public NomBotV2()
- {
- discord = new DiscordClient(x => { x.LogHandler = Log; x.LogLevel = LogSeverity.Info; });
- discord.UsingCommands(x =>
- {
- x.PrefixChar = '~';
- x.AllowMentionPrefix = true;
- });
- var commands = discord.GetService<CommandService>();
- commands.CreateCommand("censor").Parameter("censorID").Do(async (e) =>
- {
- if (e.User.Id == 204441911489069056)
- {
- censorID = e.GetArg("censorID");
- }
- });
- // Spam Filter
- discord.MessageReceived += async (s, e) =>
- {
- if (e.User.IsBot)
- { }
- else
- {
- var channel = e.Server.FindChannels("general", ChannelType.Text).FirstOrDefault();
- var user = discord.CurrentUser;
- spamold = spamnew;
- Message[] messagesToObtain;
- messagesToObtain = await e.Channel.DownloadMessages(2);
- spamnew = messagesToObtain[0].Text;
- if (spamnew == spamold)
- {
- Message[] messagesToDelete;
- messagesToDelete = await e.Channel.DownloadMessages(1);
- await e.Channel.DeleteMessages(messagesToDelete);
- // TESTING TEXT SENDING COMMANDS
- // await e.Channel.SendMessage(messagesToDelete.ToString());
- // await e.Channel.SendMessage(spamnew);
- // await e.Channel.SendMessage(spamold);
- }
- else
- {
- if (messagesToObtain[0].User.Id.ToString() == censorID)
- {
- Message[] messagesToDelete;
- messagesToDelete = await e.Channel.DownloadMessages(1);
- await e.Channel.DeleteMessages(messagesToDelete);
- }
- };
- }
- };
- // COMMANDS
- // To add a simple text command, use the following format:
- /*/
- commands.CreateCommand("")
- .Do(async (e) =>
- {
- await e.Channel.SendMessage("");
- });
- /*/
- discord.UserJoined += async (s, e) =>
- {
- var channel = e.Server.FindChannels("general", ChannelType.Text).FirstOrDefault();
- var user = discord.CurrentUser;
- if (e.Server.Id == 233717585605033984)
- {
- await channel.SendMessage(string.Format("Welcome to the Paradox Infinity Server ", user.Mention, "!"));
- }
- if (e.Server.Id == 254302003188989953)
- {
- await channel.SendMessage(string.Format("Welcome to Nom's Server ", user.Mention, "!"));
- }
- if (e.Server.Id == 299653823503400960)
- {
- await channel.SendMessage(string.Format("Welcome to the Realm of NomBot Server; Please PM Nom for the ability to recommend things! ", string.Format(user.Name), "!"));
- Role Spectator = null;
- //await user.AddRoles(Spectator);
- }
- };
- commands.CreateCommand("pfft")
- .Do(async (e) =>
- {
- if (e.Channel.IsPrivate == true) { }
- else
- {
- await e.Channel.SendMessage("https://ifunny.co/fun/J4RIgcX44"); }
- });
- /*/ Channel.Client.UserJoined += async (s, e) =>
- {
- Discord.Role Spectator = null;
- await e.User.AddRoles(Spectator);
- }; ; /*/
- commands.CreateCommand("startup").Do((e) =>
- {
- if (e.Channel.IsPrivate == true) { }
- else
- {
- e.User.Server.Client.SetGame("with atom bombs.");
- }
- });
- commands.CreateCommand("~").Do(async (e) =>
- {
- if (e.Channel.IsPrivate == true) { }
- else
- {
- await e.Channel.SendMessage("Are you broken?");
- }
- });
- // RANK SYSTEM
- commands.CreateCommand("rank").Do((e) =>
- {
- ;
- });
- discord.MessageReceived += (s, e) =>
- {
- rank = rank + e.User.Id;
- };
- //
- //
- commands.CreateCommand("tatsumaki")
- .Do(async (e) =>
- {
- await e.Channel.SendMessage("Boy, I sure do hate @Tatsumaki 's Japanese guts!");
- });
- commands.CreateCommand("hi")
- .Do(async (e) =>
- {
- await e.Channel.SendMessage("Hi! I'm NomBot! I'm a random creation of Zomon333 to test stuff like his coding skills! Use ~help or ~commands for more info!");
- });
- commands.CreateCommand("info1")
- .Do(async (e) =>
- {
- await e.Channel.SendMessage("This bot was made by Zomon333 using the Discord API in C#, a language that Zomon has technically never learned. (Use ~info2 for more)");
- });
- commands.CreateCommand("info2")
- .Do(async (e) =>
- {
- await e.Channel.SendMessage("Primarily a test, this bot will eventually have loads of fun features including but not limited to simple math, image sharing, cheezy jokes. (Use ~info3 for more)");
- });
- commands.CreateCommand("info3")
- .Do(async (e) =>
- {
- await e.Channel.SendMessage("To further exacerbate the cheezy jokes, this bot was also created to throw automated insults at specific people in specific discord servers. Whether or not this will be implemented is yet to be determined.");
- });
- commands.CreateCommand("nomsucks")
- .Do(async (e) =>
- {
- await e.Channel.SendMessage("Fuck off.");
- });
- commands.CreateCommand("jerry")
- .Do(async (e) =>
- {
- await e.Channel.SendMessage("OH, FUCK ME JERRY!");
- });
- commands.CreateCommand("nom")
- .Do(async (e) =>
- {
- await e.Channel.SendMessage("Uber mecha nazi hitler on steroids with an antifreeze flamethrower and diagrams for an atom bomb.");
- });
- commands.CreateCommand("flam")
- .Do(async (e) =>
- {
- await e.Channel.SendMessage("THE DOCTOR IS IN THE HOUSE. EVERYBODY STEP BACK, HE'LL PROBABLY KILL SOMEBODY.");
- });
- commands.CreateCommand("hands")
- .Do(async (e) =>
- {
- await e.Channel.SendMessage("http://www.greatdreams.com/war/black_hole.jpg ; This is a hole through which I collect millions of baby hands.");
- });
- commands.CreateCommand("white")
- .Do(async (e) =>
- {
- await e.Channel.SendMessage("Whities gotta pay. And the payment is baby hands.");
- });
- commands.CreateCommand("forgive")
- .Do(async (e) =>
- {
- await e.Channel.SendMessage(" ' That's the sound of forgiveness!' 'No, that's the sound of people drowning Carl' 'That's also what forgiveness sounds like! Screaming and then silence!' ");
- });
- commands.CreateCommand("boat")
- .Do(async (e) =>
- {
- await e.Channel.SendMessage("Boat nectarrrrrr");
- });
- commands.CreateCommand("resist")
- .Do(async (e) =>
- {
- await e.Channel.SendMessage("VIVE LE RESISTANCE");
- });
- commands.CreateCommand("pig")
- .Do(async (e) =>
- {
- await e.Channel.SendMessage("NuclearPigz is *swine*. He's the bane of my existance!");
- });
- commands.CreateCommand("bunny")
- .Do(async (e) =>
- {
- await e.Channel.SendMessage(":rabbit:");
- });
- commands.CreateCommand("cat")
- .Do(async (e) =>
- {
- await e.Channel.SendMessage("Meow");
- });
- commands.CreateCommand("dog")
- .Do(async (e) =>
- {
- await e.Channel.SendMessage("Woof");
- });
- commands.CreateCommand("doge")
- .Do(async (e) =>
- {
- await e.Channel.SendMessage("https://i.ytimg.com/vi/Nl5r-uoB2C4/maxresdefault.jpg");
- });
- // Displays opinion about select people
- commands.CreateCommand("fren")
- .Do(async (e) =>
- {
- if (e.User.Id == 204441911489069056)
- {
- await e.Channel.SendMessage("Yas Nom Iz Fren");
- }
- else
- {
- if (e.User.Id == 239151547320238080)
- {
- await e.Channel.SendMessage("Yas Flam be fren");
- }
- if (e.User.Id == 234516941593772033)
- {
- await e.Channel.SendMessage("NU. NUKZ NO BE FREN FILTHEH PIGGEH.");
- }
- if (e.User.Id == 227539180648005633)
- {
- await e.Channel.SendMessage("Silly wabbit, Of course you're the friend of NomBot!");
- }
- if (e.User.Id == 214602261198929920)
- {
- await e.Channel.SendMessage("*ignores Kaotic*");
- }
- if (e.User.Id == 247917427222904832)
- {
- await e.Channel.SendMessage("kekekekekekekekekekekekekekekekekekekekekekekekekekekekekekekekekekekekekekekekekekekek");
- }
- if (e.User.Id == 136869144816517120)
- {
- await e.Channel.SendMessage("danny BOIIIIIIIIIIIIIIIIIII");
- }
- if (e.User.Id == 168171650137849856)
- {
- await e.Channel.SendMessage("Sure, why not. Can't see what could go wrong... ");
- }
- if (e.User.Id == 233719574544121866)
- {
- await e.Channel.SendMessage("HAHAHAHAHAHAHAHAHAHAHHAHAHH... Clearly you don't know me! Or do you :3");
- }
- if (e.User.Id == 136869144816517120)
- {
- await e.Channel.SendMessage("You are so retarted, I'm surprised you could even find the damned enter key. I hope you die by drowning in your own fecal matter.");
- }
- if (e.User.Id == 241749258875830272)
- {
- await e.Channel.SendMessage("I hope you die.");
- }
- if (e.User.Id == 308946843642101761)
- {
- await e.Channel.SendMessage("Chicken of the sea.");
- }
- if (e.User.Id == 288777229037731842)
- {
- await e.Channel.SendMessage("DIEDIEDIEDIEDIEDIEDIEDIEDIEDIEDIEDIEDIEDIEDIEDIEDIEDIEDIEDIEDIEDIEDIEDIEDIEDIEDIEDIEDIEDIEDIEDIEDIEDIE");
- }
- }
- });
- // Obscene Holocaust Joke
- commands.CreateCommand("holo")
- .Do(async (e) =>
- {
- await e.Channel.SendMessage(":fire: CAUST https://cdn-www.terminix.com/cs/ahs/image/right-oven-for-kitchen.jpg");
- });
- commands.CreateCommand("kkk")
- .Do(async (e) =>
- {
- await e.Channel.SendMessage("LINCH THE BLACKSLINCH THE BLACKSLINCH THE BLACKSLINCH THE BLACKSLINCH THE BLACKSLINCH THE BLACKSLINCH THE BLACKSLINCH THE BLACKSLINCH THE BLACKS");
- });
- commands.CreateCommand("daniel")
- .Do(async (e) =>
- {
- await e.Channel.SendMessage("https://www.youtube.com/watch?v=UDYMUd4X_aA");
- });
- commands.CreateCommand("jew")
- .Do(async (e) =>
- {
- await e.Channel.SendMessage(":fire: :star_of_david: :fire:");
- });
- //
- commands.CreateCommand("bun")
- .Do(async (e) =>
- {
- await e.Channel.SendMessage("https://cdn.discordapp.com/attachments/233717585605033984/312047412979957780/unknown.png");
- //
- });
- commands.CreateCommand("")
- .Do(async (e) =>
- {
- await e.Channel.SendMessage("");
- });
- // Informs people of helpful commands
- commands.CreateCommand("help")
- .Do(async (e) =>
- {
- await e.Channel.SendMessage("Use ~info[1-3], or ~commands");
- });
- // Lists Non-Secret Commands
- commands.CreateCommand("commands")
- .Do(async (e) =>
- {
- await e.Channel.SendMessage("Commands: ~add, ~sub, ~div, ~mult, ~fact, ~help, ~responsible, ~holo, ~fren, ~doge, ~dog, ~cat, ~bunny, ~pig, ~resist, ~boat, ~forgive, ~hands, ~white, ~flam, ~nom, ~jerry, ~nomsucks, ~kaotic, ~info1, ~info2, ~info3, ~hi, ~grandprize, ~sped");
- });
- // Lists Responsible Quote
- commands.CreateCommand("responsible")
- .Do(async (e) =>
- {
- await e.Channel.SendMessage(" ' I'm glad you were responsible for once ' (continues to add more chaotic commands)");
- });
- // Lists Kaotic Joke
- commands.CreateCommand("kaotic")
- .Do(async (e) =>
- {
- await e.Channel.SendMessage("Actually rather tame. http://static.boredpanda.com/blog/wp-content/uploads/2016/08/cute-kittens-30-57b30ad41bc90__605.jpg");
- });
- // Questionable Commands
- commands.CreateCommand("grandprize")
- .Do(async (e) =>
- {
- await e.Channel.SendMessage("Here's your 'Prize' : http://imgur.com/SNe7ZRS");
- });
- commands.CreateCommand("sped")
- .Do(async (e) =>
- {
- await e.Channel.SendMessage("Toasty Jenessa; http://i.imgur.com/LesDUeQ.jpg ");
- await e.Channel.SendMessage("You fucking sped, burn in my toasty hitlery oven!");
- });
- discord.UserIsTyping += async (s, e) =>
- {
- e.User.Server.Client.SetGame("with atom bombs.");
- };
- commands.CreateCommand("faggot").Do(async (e) =>
- {
- await e.Channel.SendMessage("http://combiboilersleeds.com/images/sticks/sticks-2.jpg");
- // await e.Channel.SendMessage("http://i.imgur.com/YYviard.png");
- });
- commands.CreateCommand("kys").Do(async (e) =>
- {
- await e.Channel.SendMessage("https://www.youtube.com/watch?v=ByC8sRdL-Ro");
- });
- /*/ discord.MessageReceived += (s, e) =>
- {
- string User = e.User.Name;
- list.Add(User);
- };
- commands.CreateCommand("rank").Do((e) =>
- {
- string User = e.User.Name;
- foreach (string names in list){
- if (names == User)
- {
- totalscore= totalscore + 1;
- }
- }
- e.Channel.SendMessage(ToString(totalscore));
- });/*/
- /*/ BrownTrout commands /*/
- commands.CreateCommand("joke")
- .Do(async (e)=> {
- await e.Channel.SendMessage("Why did the bubblegum cross the road? ~");
- await e.Channel.SendMessage("~ *Because it was stuck to the chicken's foot*");
- });
- // commands.CreateCommand("who's awesome?")
- // .Do(async (e) =>
- // {
- // await e.Channel.SendMessage("Flappeh!");
- // });
- commands.CreateCommand("canser")
- .Do(async (e) =>
- {
- await e.Channel.SendMessage("http://ll-media.tmz.com/2014/12/09/mariah-carey-200x250.jpg");
- await e.Channel.SendMessage("Mariah Carey!");
- });
- /*/ Math Commands /*/
- // Addition
- commands.CreateCommand("add" + x + y)
- .Parameter("Target1", ParameterType.Required)
- .Parameter("Target2", ParameterType.Optional)
- .Do(async (e) =>
- {
- inputa= e.GetArg("Target1");
- inputb = e.GetArg("Target2");
- a = float.Parse(inputa);
- b = float.Parse(inputb);
- c = a + b;
- await e.Channel.SendMessage("Your result is " + c);
- });
- // Division
- commands.CreateCommand("div" + x + y)
- .Parameter("Target1", ParameterType.Required)
- .Parameter("Target2", ParameterType.Optional)
- .Do(async (e) =>
- {
- inputa = e.GetArg("Target1");
- inputb = e.GetArg("Target2");
- a = float.Parse(inputa);
- b = float.Parse(inputb);
- c = a/b;
- await e.Channel.SendMessage("Your result is " + c);
- });
- // Multiplication
- commands.CreateCommand("mult" + x + y)
- .Parameter("Target1", ParameterType.Required)
- .Parameter("Target2", ParameterType.Optional)
- .Do(async (e) =>
- {
- inputa = e.GetArg("Target1");
- inputb = e.GetArg("Target2");
- a = float.Parse(inputa);
- b = float.Parse(inputb);
- c = a*b;
- await e.Channel.SendMessage("Your result is " + c);
- });
- // Subtraction
- commands.CreateCommand("sub" + x + y)
- .Parameter("Target1", ParameterType.Required)
- .Parameter("Target2", ParameterType.Optional)
- .Do(async (e) =>
- {
- inputa = e.GetArg("Target1");
- inputb = e.GetArg("Target2");
- a = float.Parse(inputa);
- b = float.Parse(inputb);
- c = a - b;
- await e.Channel.SendMessage("Your result is " + c);
- });
- // Factorialization
- commands.CreateCommand("fact" + x)
- .Parameter("Target1", ParameterType.Required)
- .Do(async (e) =>
- {
- inputa = e.GetArg("Target1");
- factora = long.Parse(inputa);
- factorc = factora;
- if (factora > 0)
- {
- if (factora != 0)
- {
- if (factora <= 25)
- {
- while (factorc >= 2)
- {
- factorb = factorc - 1;
- factorc = factorc - 1;
- factora = factora * factorb;
- }
- }
- else
- {
- await e.Channel.SendMessage("Technical capabilities disallow the display of digits longer than the answer to this factorialized number. Please try again.");
- }
- }
- if (factorc <= 25)
- {
- await e.Channel.SendMessage("Your result is " + factora);
- }
- else
- { }
- }
- else
- {
- if (factora == 0)
- {
- await e.Channel.SendMessage("Your result is 1");
- }
- else
- {
- await e.Channel.SendMessage("Cannot factorialize negative numbers.");
- }
- }
- });
- // Channel Join
- discord.ExecuteAndWait(async () =>
- {
- await discord.Connect("Mjk5MzQ2MjcxNjg3Mjc4NTky.C8co-Q.s7Si64W5BlnWOShu8ZmyPxemvH4", TokenType.Bot);
- restartmethodxd();
- }); }
- private void restartmethodxd()
- {
- throw new NotImplementedException();
- }
- private string ToString(User user)
- {
- throw new NotImplementedException();
- }
- private void Client_MessageReceived(object sender, MessageEventArgs e)
- {
- throw new NotImplementedException();
- }
- // Idk
- private string ToString(float result)
- {
- throw new NotImplementedException();
- }
- // Message Logging for Bot Access
- private void Log(object sender, LogMessageEventArgs e)
- {
- Console.WriteLine(e.Message);
- }
- }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement