Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const config = require('../config/config.json')
- prefixes = config.prefixes;
- const { RichEmbed } = require("discord.js");
- const { red_dark } = require("../colors.json");
- const Discord = require('discord.js');
- const cooldowns = new Discord.Collection();
- module.exports = (client, message) => {
- var min = 1;
- var max = 6;
- var rand = Math.floor(Math.random() * (+max - +min)) + +min;
- let prefix = false;
- let embed = new RichEmbed();
- for(const thisPrefix of prefixes) {
- if(message.content.startsWith(thisPrefix)) prefix = thisPrefix;
- }
- if (message.channel.type !== 'text' && !message.content.startsWith(prefix) && !message.author.bot && message.author.id != config.ownerID) {
- embed.setColor(red_dark)
- .setAuthor(`${message.author.username} Needs Help`, message.author.avatarURL)
- .setThumbnail(message.author.avatarURL)
- .setTimestamp()
- .setDescription(`NEW DM MESSAGE!`)
- .addField('Author','Tag: ' + message.author.tag + ' ID: ' + message.author.id)
- .addField('Message', `\`\`\`${message.content}\`\`\``)
- .setFooter(`DM Message`, client.user.avatarURL)
- message.channel.send(`Sending Message To Canine`)
- return client.users.get('343180696556404736').send(embed).catch(err => {
- console.error('Coundn\'t DM Canine: ' + err);
- });
- //mychannel.send(msg.content);
- }
- if(message.content.toLowerCase().includes('everyone') && message.channel.type == 'text') {
- var server = message.guild.id;
- message.reply(`wants something <@&${server}>`);
- }
- if(message.content.toLowerCase().includes('good bot') || message.content.toLowerCase().includes('best bot') || message.content.toLowerCase().includes('bestest bot') || message.content.toLowerCase().includes('good doggo') || message.content.toLowerCase().includes('good pupper') || message.content.toLowerCase().includes('bestest doggo') || message.content.toLowerCase().includes('best doggo')) {
- switch (rand) {
- case 1:
- message.channel.send('Bestest Hooman');
- break;
- case 2:
- message.reply('is a good hooman');
- break;
- case 3:
- message.channel.send('u thot i was doggo but i am bot doggo, Bamboozeled again');
- break;
- case 4:
- message.channel.send('I luv ou hooman');
- break;
- default:
- message.channel.send('good hooman');
- break;
- }
- }
- if(!prefix) return;
- if (!message.content.startsWith(prefix) || message.author.bot) return;
- const args = message.content.slice(prefix.length).split(/ +/);
- const commandName = args.shift().toLowerCase();
- client = client;
- const command = client.commands.get(commandName)
- || client.commands.find(cmd => cmd.aliases && cmd.aliases.includes(commandName));
- console.log(`Attempting to run ${commandName}`);
- if (!command) return console.log(`Attempted to run ${commandName} But it doesnt exist or Could not be found!`);
- if (command.guildOnly && message.channel.type !== 'text') {
- return message.reply('I can\'t execute that command inside DMs!');
- }
- if (command.ownerOnly && message.author.id != config.ownerID) {
- return console.log(`Someone Tried to use The Owner Command: ${commandName}`);
- }
- if (message.channel.type == 'text' && message.author.id != config.ownerID && command.adminOnly &! message.member.hasPermission('MANAGE_GUILD')) {
- return message.channel.send(`${message.author.tag} tried to use an Admin Command`);
- }
- if (command.args && !args.length) {
- let reply = `This Command Requires Arguments, ${message.author} You Mortal!`;
- if (command.usage) {
- reply += `\nThe proper usage would be: \`${prefix}${command.name} ${command.usage}\``;
- }
- return message.channel.send(reply);
- }
- if (!cooldowns.has(command.name)) {
- cooldowns.set(command.name, new Discord.Collection());
- }
- const now = Date.now();
- const timestamps = cooldowns.get(command.name);
- const cooldownAmount = (command.cooldown || 3) * 1000;
- if (timestamps.has(message.author.id)) {
- const expirationTime = timestamps.get(message.author.id) + cooldownAmount;
- if (message.author.id != config.ownerID && now < expirationTime) {
- const timeLeft = (expirationTime - now) / 1000;
- return message.reply(`please wait ${timeLeft.toFixed(1)} more second(s) before reusing the \`${command.name}\` command.`);
- }
- }
- timestamps.set(message.author.id, now);
- setTimeout(() => timestamps.delete(message.author.id), cooldownAmount);
- try {
- command.execute(client, message, args);
- console.log(`Ran ${commandName}`);
- } catch (error) {
- console.error(error);
- message.reply('there was an error trying to execute that command!');
- }
- // Run the command
- // command.run(client, msg, args);
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement