const Discord = require('discord.js'); const client = new Discord.Client(); const mongoose = require('mongoose'); const prefix = '-'; const config = require('./config.json') const fs = require('fs'); require('dotenv').config(); const cooldowns = new Discord.Collection(); client.commands = new Discord.Collection(); const commandFiles = fs.readdirSync('./commands/').filter(file => file.endsWith('.js')); for(const file of commandFiles){ const command = require(`./commands/${file}`); client.commands.set(command.name, command); } client.once('ready', async () => { console.log('I Am Now Online!'); }); client.on('message', async (message) => { const profileModel = require("../Bot/models/profileSchema"); if(!message.content.startsWith(prefix) || message.author.bot) return; let profileData; try { profileData = await profileModel.findOne({ userID: message.author.id }); if (!profileData) { let profile = await profileModel.create({ userID: message.author.id, serverID: message.guild.id, coins: 1000, bank: 0, }); profile.save(); } } catch (err) { console.log(err); } const args = message.content.slice(prefix.length).split(/ +/); const command = args.shift().toLowerCase(); 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 (now < expirationTime) { const timeLeft = (expirationTime - now) / 1000; const avatar = message.author.avatarURL({ dynamic:true }); const Embed221r = new Discord.MessageEmbed() .setColor('RANDOM') .setDescription(`**Sorry <@${message.author.id}>, You Need To Wait \`${timeLeft.toFixed(1)}\` More Seconds Before Using \`-${command.name}\` Again**`) .setFooter(`Yep, Need To Wait`, `${avatar}`); return message.reply(Embed221r); } } timestamps.set(message.author.id, now); setTimeout(() => timestamps.delete(message.author.id), cooldownAmount); if(command === 'youtube'){ client.commands.get('youtube').execute(message, args, Discord, profileData); } else if (command == 'hi'){ client.commands.get('hi').execute(message, args, profileData); } else if (command == 'twitch'){ client.commands.get('twitch').execute(message, args, Discord, profileData); } else if (command == 'commands'){ client.commands.get('commands').execute(message, args, Discord, profileData); } else if (command == 'bye'){ client.commands.get('bye').execute(message, args, profileData); } else if (command == 'potato'){ client.commands.get('potato').execute(message, args, Discord, profileData); } else if (command == 'simp'){ client.commands.get('simp').execute(message, args, profileData); } else if (command == 'ban'){ client.commands.get('ban').execute(message, args, Discord, profileData); } else if (command == 'verify'){ client.commands.get('verify').execute(message, args, profileData); } else if (command == 'creator'){ client.commands.get('creator').execute(message, args, Discord, profileData); } else if (command == 'discord'){ client.commands.get('discord').execute(message, args, Discord, profileData); } else if (command == 'quote'){ client.commands.get('quote').execute(message, args, Discord, profileData); } else if (command == 'ok'){ client.commands.get('ok').execute(message, args, Discord, profileData); } else if (command == 'bruh'){ client.commands.get('bruh').execute(message, args, profileData); } else if (command == 'dio'){ client.commands.get('dio').execute(message, args, profileData); } else if (command == 'slap'){ client.commands.get('slap').execute(message, args, profileData); } else if (command == 'berry'){ client.commands.get('berry').execute(message, args, profileData); } else if (command == 'help'){ client.commands.get('help').execute(message, args, Discord, profileData); } else if (command == 'socials'){ client.commands.get('socials').execute(message, args, Discord, profileData); } else if (command == 'twitter'){ client.commands.get('twitter').execute(message, args, Discord, profileData); } else if (command == 'insta'){ client.commands.get('insta').execute(message, args, Discord, profileData); } else if (command == 'clock'){ client.commands.get('clock').execute(message, args, Discord, profileData); } else if (command == 'pog'){ client.commands.get('pog').execute(message, args, Discord, profileData); } else if (command == 'punch'){ client.commands.get('punch').execute(message, args, profileData); } else if (command == 'stare'){ client.commands.get('stare').execute(message, args, profileData); } else if (command == 'kick'){ client.commands.get('kick').execute(message, args, Discord, profileData); } else if (command == 'clear'){ client.commands.get('clear').execute(message, args, Discord, profileData); } else if (command == 'anime'){ client.commands.get('anime').execute(message, args, Discord, profileData); } else if (command == 'actionlist'){ client.commands.get('actionlist').execute(message, args, Discord, profileData); } else if (command == 'shippuden'){ client.commands.get('shippuden').execute(message, args, Discord, profileData); } else if (command == 'naruto'){ client.commands.get('naruto').execute(message, args, profileData); } else if (command == 'itachi'){ client.commands.get('itachi').execute(message, args, profileData); } else if (command == 'sasuke'){ client.commands.get('sasuke').execute(message, args, profileData); } else if (command == 'sakura'){ client.commands.get('sakura').execute(message, args, profileData); } else if (command == 'hinata'){ client.commands.get('hinata').execute(message, args, profileData); } else if (command == 'orochimaru'){ client.commands.get('orochimaru').execute(message, args, profileData); } else if (command == 'kakashi'){ client.commands.get('kakashi').execute(message, args, profileData); } else if (command == 'mute'){ client.commands.get('mute').execute(message, args, Discord, profileData); } else if (command == 'unmute'){ client.commands.get('unmute').execute(message, args, Discord, profileData); } else if (command == 'spammers'){ client.commands.get('spammers').execute(message, args, profileData); } else if (command == 'hangers'){ client.commands.get('hangers').execute(message, args, profileData); } else if (command == 'ben'){ client.commands.get('ben').execute(message, args, profileData); } else if (command == 'redcolor'){ client.commands.get('redcolor').execute(message, args, Discord, profileData); } else if (command == 'orangecolor'){ client.commands.get('orangecolor').execute(message, args, Discord, profileData); } else if (command == 'yellowcolor'){ client.commands.get('yellowcolor').execute(message, args, Discord, profileData); } else if (command == 'greencolor'){ client.commands.get('greencolor').execute(message, args, Discord, profileData); } else if (command == 'limecolor'){ client.commands.get('limecolor').execute(message, args, Discord, profileData); } else if (command == 'bluecolor'){ client.commands.get('bluecolor').execute(message, args, Discord, profileData); } else if (command == 'pinkcolor'){ client.commands.get('pinkcolor').execute(message, args, Discord, profileData); } else if (command == 'purplecolor'){ client.commands.get('purplecolor').execute(message, args, Discord, profileData); } else if (command == 'browncolor'){ client.commands.get('browncolor').execute(message, args, Discord, profileData); } else if (command == 'blackcolor'){ client.commands.get('blackcolor').execute(message, args, Discord, profileData); } else if (command == 'whitecolor'){ client.commands.get('whitecolor').execute(message, args, Discord, profileData); } else if (command == 'trigger'){ client.commands.get('trigger').execute(message, args, profileData); } else if (command == 'delete'){ client.commands.get('delete').execute(message, args, profileData); } else if (command == 'rip'){ client.commands.get('rip').execute(message, args, profileData); } else if (command == 'jail'){ client.commands.get('jail').execute(message, args, profileData); } else if (command == 'sadpog'){ client.commands.get('sadpog').execute(message, args, Discord, profileData); } else if (command == 'trash'){ client.commands.get('trash').execute(message, args, profileData); } else if (command == 'cyancolor'){ client.commands.get('cyancolor').execute(message, args, Discord, profileData); } else if (command == 'bounty'){ client.commands.get('bounty').execute(message, args, profileData); } else if (command == 'facts'){ client.commands.get('facts').execute(message, args, Discord, profileData); } else if (command == 'invert'){ client.commands.get('invert').execute(message, args, profileData); } else if (command == 'worse'){ client.commands.get('worse').execute(message, args, profileData); } else if (command == 'test'){ client.commands.get('test').execute(message, args, Discord, profileData); } else if (command == 'affect'){ client.commands.get('affect').execute(message, args, profileData); } else if (command == 'admire'){ client.commands.get('admire').execute(message, args, profileData); } else if (command == 'blur'){ client.commands.get('blur').execute(message, args, profileData); } else if (command == 'frame'){ client.commands.get('frame').execute(message, args, profileData); } else if (command == 'unban'){ client.commands.get('unban').execute(message, args, Discord, profileData); } else if (command == 'partner'){ client.commands.get('partner').execute(message, args, Discord, profileData); } else if (command == 'pest'){ client.commands.get('pest').execute(message, args, Discord, profileData); } else if (command == 'collection'){ client.commands.get('collection').execute(message, args, Discord, profileData); } else if (command == 'kill'){ client.commands.get('kill').execute(message, args, Discord, profileData); } else if (command == 'invite'){ client.commands.get('invite').execute(message, args, Discord, profileData); } else if (command == 'CreateRR'){ client.commands.get('CreateRR').execute(message, args, profileData); } else if (command == 'memberinfo'){ client.commands.get('memberinfo').execute(message, args, Discord, profileData); } else if (command == 'roles'){ client.commands.get('roles').execute(message, args, Discord, profileData); } else if (command == 'pings'){ client.commands.get('pings').execute(message, args, Discord, profileData); } else if (command == 'role_remove'){ client.commands.get('role_remove').execute(message, args, Discord, profileData); } else if (command == 'check'){ client.commands.get('check').execute(message, args, Discord, profileData); } else if (command == 'gamer_rate'){ client.commands.get('gamer_rate').execute(message, args, Discord, profileData); } else if (command == 'cute_rate'){ client.commands.get('cute_rate').execute(message, args, Discord, profileData); } else if (command == 'ugly_rate'){ client.commands.get('ugly_rate').execute(message, args, Discord, profileData); } else if (command == 'smart_rate'){ client.commands.get('smart_rate').execute(message, args, Discord, profileData); } else if (command == 'dumb_rate'){ client.commands.get('dumb_rate').execute(message, args, Discord, profileData); } else if (command == 'gay_rate'){ client.commands.get('gay_rate').execute(message, args, Discord, profileData); } else if (command == 'simp_rate'){ client.commands.get('simp_rate').execute(message, args, Discord, profileData); } else if (command == 'sus_rate'){ client.commands.get('sus_rate').execute(message, args, Discord, profileData); } else if (command == 'dogeyinfo'){ client.commands.get('dogeyinfo').execute(message, args, Discord, profileData); } else if (command == 'bal'){ client.commands.get('bal').execute(message, args, Discord, profileData); } else if (command == 'balance'){ client.commands.get('balance').execute(message, args, Discord, profileData); } else if (command == 'beg'){ client.commands.get('beg').execute(message, args, Discord, profileData); } else if (command == 'dep'){ client.commands.get('dep').execute(message, args, Discord, profileData); } else if (command == 'deposit'){ client.commands.get('deposit').execute(message, args, Discord, profileData); } else if (command == 'with'){ client.commands.get('with').execute(message, args, Discord, profileData); } else if (command == 'withdraw'){ client.commands.get('withdraw').execute(message, args, Discord, profileData); } }); mongoose.connect(process.env.MONGODB_SRV, { useNewUrlParser: true, useUnifiedTopology: true, useFindAndModify: false }).then(()=>{ console.log('Connected To The Mongoose/Mongo Database!'); }).catch((err) =>{ console.log(err); }); client.on('guildMemberAdd', async guildMember => { const profileModel = require("../Bot/models/profileSchema"); let profileData; try { profileData = await profileModel.findOne({ userID: guildMember.id }); if (!profileData) { let profile = await profileModel.create({ userID: guildMember.id, serverID: guildMember.id, coins: 1000, bank: 0, }); profile.save(); } } catch (err) { console.log(err); } if(guildMember.guild.id == '673678238781800518'){ const profileModel = require("../Bot/models/profileSchema"); let profileData; try { profileData = await profileModel.findOne({ userID: guildMember.id }); if (!profileData) { let profile = await profileModel.create({ userID: guildMember.id, serverID: guildMember.id, coins: 1000, bank: 0, }); profile.save(); } } catch (err) { console.log(err); } let welcomeRole = guildMember.guild.roles.cache.find(role => role.name === '🍼Baby Doges🍼'); let goodbyeRole = guildMember.guild.roles.cache.find(role => role.name === 'Unverified'); let justrole = guildMember.guild.roles.cache.find(role => role.name === 'Cmon Dudes Read The Rules AND VERIFY'); let colorrole = guildMember.guild.roles.cache.find(role => role.name === '--------------👆Color Roles👆-------------'); let whatrole = guildMember.guild.roles.cache.find(role => role.name === '------------👆What You Are👆------------'); let chatrole = guildMember.guild.roles.cache.find(role => role.name === '--------------👆Chat Roles👆--------------'); let pingrole = guildMember.guild.roles.cache.find(role => role.name === '--------------👆Ping Roles👆--------------'); let uniquerole = guildMember.guild.roles.cache.find(role => role.name === '------------👆Unique Roles👆------------'); guildMember.roles.add(welcomeRole); guildMember.roles.add(goodbyeRole); guildMember.roles.add(justrole); guildMember.roles.add(colorrole); guildMember.roles.add(whatrole); guildMember.roles.add(chatrole); guildMember.roles.add(pingrole); guildMember.roles.add(uniquerole); const welcomechannel = client.channels.cache.get('675173793483980808') welcomechannel.send(`Hey <@${guildMember.user.id}> , Welcome To The **Dogey Army**. Please Read The Dm You've Gotten By <@159985870458322944> For Steps To Unlock The Server!`); console.log(`MEMBER JOINED: Hey, A New Member Joined Dogey Army!`); } }); client.on('guildMemberRemove', (guildMember) => { if(guildMember.guild.id == '673678238781800518'){ const Goodbyechannel = client.channels.cache.get('678048512822476804') Goodbyechannel.send(`<@${guildMember.id}> Just Left The Server <:AnimeCry45:808375412383809567>`); console.log(`MEMBER LEFT: A Member Has Left Dogey Army!`); } }); client.on('guildDelete', (guild) => { console.log(`I Have Got Kicked From A Guild ;-;. Now At ${client.guilds.cache.size} Servers!`); }); client.on('guildCreate', (guild) => { const hereEmbed = new Discord.MessageEmbed() .setColor('#CB9800') .setTitle('Thanks For Inviting Me!') .setURL('https://bit.ly/inv-dogey') .setAuthor('Dogey', 'https://images-ext-1.discordapp.net/external/F8r7n0khYiZb9LjfYRXbNavuzjryecT3qa7puX-qIQ8/https/images-ext-2.discordapp.net/external/01CdrA7iJmII0DsyvZHfVw1MvK44KfnbGMJDclW5-4Q/https/cdn.discordapp.com/avatars/771162988740739083/f5e4cc8fffed775f34e3aa007915bf7f.webp', 'https://bit.ly/inv-dogey') .setDescription('**My Prefix Is `-`!**') .setThumbnail('https://images-ext-1.discordapp.net/external/F8r7n0khYiZb9LjfYRXbNavuzjryecT3qa7puX-qIQ8/https/images-ext-2.discordapp.net/external/01CdrA7iJmII0DsyvZHfVw1MvK44KfnbGMJDclW5-4Q/https/cdn.discordapp.com/avatars/771162988740739083/f5e4cc8fffed775f34e3aa007915bf7f.webp') .addFields( {name: '**Want A Full List Of Commands?**', value: '**Type `-help`**', inline: true}, ) .setImage('https://images-ext-1.discordapp.net/external/F8r7n0khYiZb9LjfYRXbNavuzjryecT3qa7puX-qIQ8/https/images-ext-2.discordapp.net/external/01CdrA7iJmII0DsyvZHfVw1MvK44KfnbGMJDclW5-4Q/https/cdn.discordapp.com/avatars/771162988740739083/f5e4cc8fffed775f34e3aa007915bf7f.webp') .setTimestamp() .setFooter('The Date I Joined ->', 'https://images-ext-1.discordapp.net/external/F8r7n0khYiZb9LjfYRXbNavuzjryecT3qa7puX-qIQ8/https/images-ext-2.discordapp.net/external/01CdrA7iJmII0DsyvZHfVw1MvK44KfnbGMJDclW5-4Q/https/cdn.discordapp.com/avatars/771162988740739083/f5e4cc8fffed775f34e3aa007915bf7f.webp'); const hereEmbed2 = new Discord.MessageEmbed() .setColor('#CB9800') .setTitle('Thanks For Inviting Me To This Server But Im Missing Administrator As One Of My Perms!') .setURL('https://bit.ly/inv-dogey') .setAuthor('Dogey', 'https://images-ext-1.discordapp.net/external/F8r7n0khYiZb9LjfYRXbNavuzjryecT3qa7puX-qIQ8/https/images-ext-2.discordapp.net/external/01CdrA7iJmII0DsyvZHfVw1MvK44KfnbGMJDclW5-4Q/https/cdn.discordapp.com/avatars/771162988740739083/f5e4cc8fffed775f34e3aa007915bf7f.webp', 'https://bit.ly/inv-dogey') .setDescription('**My Prefix Is `-`!**') .setThumbnail('https://images-ext-1.discordapp.net/external/F8r7n0khYiZb9LjfYRXbNavuzjryecT3qa7puX-qIQ8/https/images-ext-2.discordapp.net/external/01CdrA7iJmII0DsyvZHfVw1MvK44KfnbGMJDclW5-4Q/https/cdn.discordapp.com/avatars/771162988740739083/f5e4cc8fffed775f34e3aa007915bf7f.webp') .addFields( {name: '**If I Do Not Have Administrator, I Cant Work Properly <:AnimeCry45:808375412383809567>**', value: '**Go To My Role On The Role List And Give Me Administrator!**', inline: true}, {name: '**Want A Full List Of Commands?**', value: '**Type `-help`**', inline: true}, ) .setImage('https://images-ext-1.discordapp.net/external/F8r7n0khYiZb9LjfYRXbNavuzjryecT3qa7puX-qIQ8/https/images-ext-2.discordapp.net/external/01CdrA7iJmII0DsyvZHfVw1MvK44KfnbGMJDclW5-4Q/https/cdn.discordapp.com/avatars/771162988740739083/f5e4cc8fffed775f34e3aa007915bf7f.webp') .setTimestamp() .setFooter('The Date I Joined ->', 'https://images-ext-1.discordapp.net/external/F8r7n0khYiZb9LjfYRXbNavuzjryecT3qa7puX-qIQ8/https/images-ext-2.discordapp.net/external/01CdrA7iJmII0DsyvZHfVw1MvK44KfnbGMJDclW5-4Q/https/cdn.discordapp.com/avatars/771162988740739083/f5e4cc8fffed775f34e3aa007915bf7f.webp'); if(guild.me.hasPermission('ADMINISTRATOR')){ guild.channels.cache.find(channel => channel.type === "text").send(hereEmbed); }else{ guild.channels.cache.find(channel => channel.type === "text").send(hereEmbed2); } console.log(`I Have Joined A New Guild. Now At ${client.guilds.cache.size} Servers!`); }); client.on('ready', () => { setInterval(function(){ let Statuses = ['"-help" For Help On Commands', 'Official Server -> bit.ly/dogeyarmy', 'Invite Dogey To Your Server -> bit.ly/inv-dogey', `Dogey Is In ${client.guilds.cache.size} Servers`]; let status = Statuses[Math.floor(Math.random()*Statuses.length)] client.user.setActivity(status) }, 5000) // client.user.setStatus('dnd'); });