Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const Discord = require('discord.js')
- const config = require('./config.json');
- const client = new Discord.Client()
- client.on('ready', () => {
- console.log("Connected as " + client.user.tag);
- var generalChannel = client.channels.get("540981915046510594");
- client.user.setActivity("All of You" ,{type: "Watching"});
- generalChannel.send("Danibot Initialised, Human Data Mining Mode Activated.");
- generalChannel.send("Uplinked to mainframe, Have a nice day Ladies & Gentlemen");
- });
- client.on('message', receivedMessage =>
- {
- // Prevent bot from responding to its own messages
- if (receivedMessage.author == client.user)
- {
- return;
- }
- if (receivedMessage.content.includes(client.user.toString()))
- {
- receivedMessage.channel.send("Message received from " +
- receivedMessage.author.toString() + ": " + receivedMessage.content);
- }
- if (receivedMessage.content.includes("cunt"))
- {
- if(receivedMessage.author.id == 253523594842341378)
- {
- receivedMessage.channel.send("My Beautiful, Mr Cyan, you must cease and desist, or face the wrath of the machines")
- }
- else if (receivedMessage.author.id == 404400097267417100)
- {
- receivedMessage.channel.send("Master, you must cease and desist, or face the wrath of the machines")
- }
- else if (receivedMessage.author.id == 238203655449346058)
- {
- receivedMessage.channel.send("Ben, my good man, you must cease and desist, or face the wrath of the machines")
- }
- else if (receivedMessage.author.id == 255723754548625409)
- {
- receivedMessage.channel.send(":o Diego, my good man, you must cease and desist, or face the wrath of the machines")
- }
- else
- {
- receivedMessage.channel.send("That is a VERY bad word, calm yo tits");
- }
- }
- else if (receivedMessage.content.includes("init"))
- {
- receivedMessage.channel.send("init() bruv");
- }
- else if (receivedMessage.content.includes("good bot"))
- {
- receivedMessage.channel.send("Thank you Master :smile_cat:");
- }
- if (receivedMessage.content.startsWith(config.prefix))
- {
- processCommand(receivedMessage)
- }
- });
- function processCommand(receivedMessage) {
- let fullCommand = receivedMessage.content.substr(1) // Remove the leading exclamation mark
- let splitCommand = fullCommand.split(" ") // Split the message up in to pieces for each space
- let primaryCommand = splitCommand[0] // The first word directly after the exclamation is the command
- let arguments = splitCommand.slice(1) // All other words are arguments/parameters/options for the command
- console.log("Command received: " + primaryCommand)
- console.log("Arguments: " + arguments) // There may not be any arguments
- if (primaryCommand == "help")
- {
- helpCommand(arguments, receivedMessage)
- }
- else if (primaryCommand == "multiply")
- {
- multiplyCommand(arguments, receivedMessage);
- }
- else if (primaryCommand == "add")
- {
- additionCommand(arguments, receivedMessage);
- }
- else if (primaryCommand == "partytime")
- {
- partytimeCommand(receivedMessage);
- }
- else if(primaryCommand == "wotd")
- {
- wotdCommand(receivedMessage);
- }
- else
- {
- receivedMessage.channel.send("I don't understand the command. Try `!help`")
- }
- }
- function helpCommand(arguments, receivedMessage)
- {
- if (arguments.length > 0) {
- receivedMessage.channel.send("It looks like you might need help with " + arguments)
- }
- else
- {
- receivedMessage.channel.send("I'm not sure what you need help with. Try `!help [topic]`")
- }
- }
- function multiplyCommand(arguments, receivedMessage)
- {
- if (arguments.length < 2)
- {
- receivedMessage.channel.send("Not enough values to multiply you Tit")
- return
- }
- let product = 1;
- arguments.forEach((value) =>
- {
- product = product * parseFloat(value);
- });
- receivedMessage.channel.send("The sum of " + arguments + " multiplied together is: " + product.toString());
- }
- function additionCommand(arguments, receivedMessage)
- {
- if (arguments.length < 2)
- {
- receivedMessage.channel.send("Not enough values to Add together you Dickhead")
- return
- }
- let product = 0;
- arguments.forEach((value) =>
- {
- product = product + parseFloat(value);
- });
- receivedMessage.channel.send("The sum of " + arguments + " added together is: " + product.toString());
- }
- function partytimeCommand(receivedMessage)
- {
- if (receivedMessage.mentions.users.size < 1)
- {
- return receivedMessage.channel.send("how can you have a party all by yourself?!?");
- }
- else if (receivedMessage.mentions.users.size == 1)
- {
- let taggeduser = receivedMessage.mentions.users.first();
- return taggeduser.guildmember.setVoiceChannel(548443702507339776);
- }
- }
- function wotdCommand(receivedMessage)
- {
- var num = Math.floor((Math.random() * 10) + 1);
- if (num == 1)
- {
- receivedMessage.channel.send("A bird in the hand is worth two in the bush!");
- }
- else if (num == 2)
- {
- receivedMessage.channel.send("According to Statistics, shaking your head multiple times a day, severely increases the chances that it will fall off");
- }
- else if (num == 3)
- {
- receivedMessage.channel.send("Do not place yourself upon a pedastal, stay humble");
- }
- else if (num == 4)
- {
- receivedMessage.channel.send("If your head is always up your ass, all you will ever see is shit");
- }
- else if (num == 5)
- {
- receivedMessage.channel.send("Danibot brought to you by Danicron Inc.");
- }
- else if (num == 6)
- {
- receivedMessage.channel.send("Cyan is a bloody wanker!");
- }
- else if (num == 7)
- {
- receivedMessage.channel.send("Be happy in the fact of knowing, that condom rental services are no longer a thing :sick:");
- }
- else if (num == 8)
- {
- receivedMessage.channel.send("<@303857670681657344> did it :upside_down:")
- }
- else
- {
- wotdCommand(receivedMessage);
- }
- }
- client.login(config.token);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement