├── .gitignore ├── Events ├── Client │ ├── disconnect.js │ ├── error.js │ ├── guildCreate.js │ ├── guildDelete.js │ ├── rateLimit.js │ ├── ready.js │ ├── reconnecting.js │ ├── shardDisconnect.js │ ├── shardError.js │ ├── shardReady.js │ ├── shardReconnected.js │ ├── shardResume.js │ └── warn.js └── Guild │ └── interactionCreate.js ├── Examples └── command.js ├── Handler ├── Antinuke.js ├── Command.js ├── Database.js ├── Database │ ├── Connect.js │ └── Premium.js ├── Events.js └── errLogger.js ├── LICENSE ├── Models ├── Antinuke.js ├── Premium.js └── Redeem.js ├── Readme.md ├── Settings ├── config.js └── emojis.js ├── bot.js ├── bun.lockb ├── commands ├── Antinuke │ ├── Disable.js │ ├── Enable.js │ ├── LogChannel.js │ ├── Settings.js │ ├── Whitelist Add.js │ ├── Whitelist Owner.js │ ├── Whitelist Remove.js │ └── Whitelist show.js ├── Premium │ ├── generate.js │ ├── redeem.js │ └── remove.js └── Utility │ ├── help.js │ └── ping.js ├── deploySlash.js ├── example.env ├── index.js ├── package.json └── shards.js /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /Events/Client/disconnect.js: -------------------------------------------------------------------------------- 1 | const { white, yellow } = require('chalk'); 2 | 3 | module.exports = async (client) => { 4 | console.log(white('[') + yellow('WARN') + white('] ') + yellow('Disconnected ') + white(`${client.user.tag} (${client.user.id})`) + yellow(' ')); 5 | }; 6 | -------------------------------------------------------------------------------- /Events/Client/error.js: -------------------------------------------------------------------------------- 1 | const { white, red } = require('chalk'); 2 | 3 | module.exports = async (client, error) => { 4 | console.log(white('[') + red('WARN') + white('] ') + red('Errored ') + white(`${client.user.tag} (${client.user.id}) ${error}`) + red(' ')); 5 | }; 6 | -------------------------------------------------------------------------------- /Events/Client/guildCreate.js: -------------------------------------------------------------------------------- 1 | const { WebhookClient, EmbedBuilder } = require("discord.js") 2 | const config = require("../../Settings/config") 3 | module.exports = async (client, guild) => { 4 | 5 | const logchannel = new WebhookClient({ 6 | url: `${config.webhook.join}` 7 | }) 8 | let guilds = client.guilds.cache.size; 9 | 10 | let owner = await guild.fetchOwner(); 11 | const embed = new EmbedBuilder() 12 | .setAuthor({ iconURL: guild.iconURL(), name: guild.name}) 13 | .setTitle("💚 Addded To New Guild") 14 | .setDescription(`Guild Name: ${guild.name} (${guild.id})\nGuild Owner: <@!${owner.id}> (${owner.id})\n Guild Members: ${guild.memberCount}\nTotal Guilds: ${guilds}`) 15 | .setColor(client.color) 16 | 17 | logchannel.send({ embeds: [embed], username: "Join Logger"}) 18 | 19 | } -------------------------------------------------------------------------------- /Events/Client/guildDelete.js: -------------------------------------------------------------------------------- 1 | const { WebhookClient, EmbedBuilder } = require("discord.js") 2 | const config = require("../../Settings/config") 3 | 4 | module.exports = async (client, guild) => { 5 | const logchannel = new WebhookClient({ 6 | url: `${config.webhook.leave}` 7 | }) 8 | let guilds = client.guilds.cache.size; 9 | 10 | let owner = await guild.fetchOwner(); 11 | const embed = new EmbedBuilder() 12 | .setAuthor({ iconURL: guild.iconURL(), name: guild.name}) 13 | .setTitle("💔 Removed From The Guild") 14 | .setDescription(`Guild Name: ${guild.name} (${guild.id})\nGuild Owner: <@!${owner.id}> (${owner.id})\n Guild Members: ${guild.memberCount}\nTotal Guilds: ${guilds}`) 15 | .setColor(client.color) 16 | 17 | logchannel.send({ embeds: [embed], username: "Leave Logger"}) 18 | 19 | 20 | 21 | } -------------------------------------------------------------------------------- /Events/Client/rateLimit.js: -------------------------------------------------------------------------------- 1 | const { white, red } = require('chalk'); 2 | 3 | module.exports = async (client, info) => { 4 | console.log(white(' [') + red('ERROR') + white('] ') + red('Rate Limited, Sleeping for ') + white(0) + red(' seconds')); 5 | } -------------------------------------------------------------------------------- /Events/Client/ready.js: -------------------------------------------------------------------------------- 1 | const { green, white } = require('chalk'); 2 | const Premium = require('../../Models/Premium'); 3 | 4 | module.exports = async (client) => { 5 | console.log(white('[') + green('INFO') + white('] ') + green(`${client.user.tag} (${client.user.id})`) + white(` is Ready!`)); 6 | 7 | const users = await Premium.find(); 8 | for (let user of users) { 9 | client.premiums.set(user.Id, user); 10 | } 11 | 12 | let guilds = client.guilds.cache.size; 13 | let members = client.guilds.cache.reduce((a, b) => a + b.memberCount, 0); 14 | let channels = client.channels.cache.size; 15 | 16 | const activities = [ 17 | `Roaming In ${guilds} servers`, 18 | `${members} users`, 19 | `Working in ${channels} channels`, 20 | ] 21 | 22 | setInterval(() => { 23 | client.user.setPresence({ 24 | activities: [{ name: `${activities[Math.floor(Math.random() * activities.length)]}`, type: 2 }], 25 | status: 'online', 26 | }); 27 | }, 15000) 28 | 29 | }; 30 | -------------------------------------------------------------------------------- /Events/Client/reconnecting.js: -------------------------------------------------------------------------------- 1 | const { white, yellow } = require('chalk'); 2 | 3 | module.exports = async (client) => { 4 | console.log(white('[') + yellow('WARN') + white('] ') + yellow('Reconnected ') + white(`${client.user.tag} (${client.user.id})`) + yellow(' ')); 5 | }; 6 | -------------------------------------------------------------------------------- /Events/Client/shardDisconnect.js: -------------------------------------------------------------------------------- 1 | const { yellow, white } = require("chalk"); 2 | 3 | module.exports = async (client, error, id) => { 4 | console.log(white('[') + yellow('WARN') + white('] ') + yellow('Shard ') + white(id) + yellow(' Shard Disconnected!')); 5 | } -------------------------------------------------------------------------------- /Events/Client/shardError.js: -------------------------------------------------------------------------------- 1 | const { red, white } = require("chalk"); 2 | 3 | module.exports = async (client, error, id) => { 4 | console.log(white('[') + red('ERROR') + white('] ') + red('Shard ') + white(id) + red(' Shard Errored!')); 5 | } -------------------------------------------------------------------------------- /Events/Client/shardReady.js: -------------------------------------------------------------------------------- 1 | const { white, green } = require("chalk"); 2 | 3 | module.exports = async (client, id) => { 4 | console.log(white('[') + green('INFO') + white('] ') + green('Shard ') + white(id) + green(' Shard Ready!')); 5 | } -------------------------------------------------------------------------------- /Events/Client/shardReconnected.js: -------------------------------------------------------------------------------- 1 | const { white, yellow } = require("chalk"); 2 | 3 | module.exports = async (client, id) => { 4 | console.log(white('[') + yellow('WARN') + white('] ') + yellow('Shard ') + white(id) + yellow(' Shard Reconnected!')); 5 | } -------------------------------------------------------------------------------- /Events/Client/shardResume.js: -------------------------------------------------------------------------------- 1 | const { white, yellow } = require("chalk"); 2 | 3 | module.exports = async (client, id) => { 4 | console.log(white('[') + yellow('WARN') + white('] ') + yellow('Shard ') + white(id) + yellow(' Shard Resumed!')); 5 | } -------------------------------------------------------------------------------- /Events/Client/warn.js: -------------------------------------------------------------------------------- 1 | const { white, yellow } = require('chalk'); 2 | 3 | module.exports = async (client) => { 4 | console.log(white('[') + yellow('WARN') + white('] ') + yellow('Warned ') + white(`${client.user.tag} (${client.user.id})`) + yellow(' ')); 5 | }; 6 | -------------------------------------------------------------------------------- /Events/Guild/interactionCreate.js: -------------------------------------------------------------------------------- 1 | const { 2 | PermissionsBitField 3 | } = require("discord.js"); 4 | const chalk = require("chalk"); 5 | module.exports = async (client, interaction) => { 6 | //=================================== Command Interaction =====================================\\ 7 | if ( 8 | interaction.isCommand || 9 | interaction.isContextMenuCommand || 10 | interaction.isChatInputCommand 11 | ) { 12 | if (!interaction.guild || interaction.user.bot) return; 13 | 14 | const user = client.premiums.get(interaction.user.id); 15 | 16 | let subCommandName = ""; 17 | try { 18 | subCommandName = interaction.options.getSubcommand(); 19 | } catch {} 20 | let subCommandGroupName = ""; 21 | try { 22 | subCommandGroupName = interaction.options.getSubcommandGroup(); 23 | } catch {} 24 | 25 | const command = client.slash.find((command) => { 26 | switch (command.name.length) { 27 | case 1: 28 | return command.name[0] == interaction.commandName; 29 | case 2: 30 | return ( 31 | command.name[0] == interaction.commandName && 32 | command.name[1] == subCommandName 33 | ); 34 | case 3: 35 | return ( 36 | command.name[0] == interaction.commandName && 37 | command.name[1] == subCommandGroupName && 38 | command.name[2] == subCommandName 39 | ); 40 | } 41 | }); 42 | if (!command) return; 43 | 44 | console.log( 45 | chalk.bgRed( 46 | `[COMMAND] ${interaction.user.tag} Used ${command.name.at(-1)} in ${ 47 | interaction.guild.name 48 | } (${interaction.guild.id})` 49 | ) 50 | ); 51 | //check default permission (must need) 52 | if ( 53 | !interaction.guild.members.me.permissions.has( 54 | PermissionsBitField.Flags.SendMessages 55 | ) 56 | ) 57 | return interaction.user.dmChannel.send( 58 | `I don't have permissions To \`SendMessages\`` 59 | ); 60 | if ( 61 | !interaction.guild.members.me.permissions.has( 62 | PermissionsBitField.Flags.ViewChannel 63 | ) 64 | ) 65 | return; 66 | if ( 67 | !interaction.guild.members.me.permissions.has( 68 | PermissionsBitField.Flags.EmbedLinks 69 | ) 70 | ) 71 | return interaction.reply({ 72 | content: `I don't have permissions To \`EmbedLinks\``, 73 | ephemeral: true, 74 | }); 75 | 76 | 77 | const { channel } = interaction.member.voice; 78 | //check in voice channel 79 | if (command.settings.inVoice) { 80 | if (!channel) 81 | return interaction.reply({ 82 | content: `Command Is Set To Be In Voice Please Get In A Voice Channel`, 83 | ephemeral: true, 84 | }); 85 | // check bot perms in voice channel 86 | if ( 87 | !interaction.guild.members.cache 88 | .get(client.user.id) 89 | .permissionsIn(channel) 90 | .has(command.permissions.channel || []) 91 | ) { 92 | return interaction.reply({ 93 | content: `I Don't have permission \`${command.permissions.bot.join(", ")}\``, 94 | ephemeral: true, 95 | }); 96 | } 97 | } 98 | 99 | //check user premium 100 | if (command.settings.isPremium && !user.isPremium) { 101 | return interaction.reply({ 102 | content: `This Command Is Set To Be Premium. So Buy Premium To Use This Command`, 103 | ephemeral: true, 104 | }); 105 | } 106 | //check owner 107 | if (command.settings.isOwner && interaction.user.id !== client.owner) { 108 | return interaction.reply({ 109 | content: `This Command Is For Owner Only`, 110 | ephemeral: true, 111 | }); 112 | } 113 | //check nsfw 114 | if(command.settings.isNSFW && !interaction.channel.nsfw) { 115 | return interaction.reply({ 116 | content: `This Command Can Be Use In Only NSFW channels`, 117 | ephemeral: true, 118 | }); 119 | } 120 | //check bot permissions in guild 121 | if ( 122 | !interaction.guild.members.me.permissions.has( 123 | command.permissions.bot || [] 124 | ) 125 | ) { 126 | return interaction.reply({ 127 | content: `I Need ${command.permissions.bot.join(", ")} To Use This Command`, 128 | ephemeral: true, 129 | }); 130 | } 131 | //check user permissions 132 | if (!interaction.member.permissions.has(command.permissions.user || [])) { 133 | return interaction.reply({ 134 | content: `You Need \`${command.permissions.user.join(", ")}\``, 135 | ephemeral: true, 136 | }); 137 | } 138 | 139 | if (command) { 140 | try { 141 | command.run(interaction, client); 142 | } catch (error) { 143 | await interaction.reply({ 144 | content: `This Slash Command Is Not Registered And Hence Not Supported`, 145 | ephmeral: true, 146 | }); 147 | } 148 | } 149 | } 150 | //=================================== Button Interaction =====================================\\ 151 | // if(interaction.isButton()) {} 152 | }; 153 | -------------------------------------------------------------------------------- /Examples/command.js: -------------------------------------------------------------------------------- 1 | const { 2 | ApplicationCommandOptionType, 3 | ChannelType, 4 | EmbedBuilder, 5 | PermissionFlagsBits, 6 | } = require("discord.js"); 7 | module.exports = { 8 | name: [], 9 | description: "", 10 | category: "", 11 | options: [], 12 | permissions: { 13 | channel: [], 14 | bot: [], 15 | user: [], 16 | }, 17 | settings: { 18 | isPremium: false, 19 | isOwner: false, 20 | inVoice: false, 21 | isNSFW: false, 22 | }, 23 | run: async (interaction, client) => {}, 24 | }; 25 | -------------------------------------------------------------------------------- /Handler/Antinuke.js: -------------------------------------------------------------------------------- 1 | const { EmbedBuilder, AuditLogEvent, PermissionFlagsBits } = require("discord.js"); 2 | const GuildSettings = require("../../Models/Antinuke"); 3 | 4 | module.exports = (client) => { 5 | //=================================== Anti Channel Events ===================================// 6 | client.on("channelCreate", async (channel) => { 7 | if(!channel.guild.members.me.permissions.has(PermissionFlagsBits.ViewAuditLog)) return; 8 | const auditlogs = await channel.guild.fetchAuditLogs({ 9 | type: AuditLogEvent.ChannelCreate, 10 | limit: 1, 11 | }); 12 | const logs = auditlogs.entries.first(); 13 | if(!logs) return; 14 | const { executor } = logs; 15 | 16 | await GuildSettings.findOne( 17 | { guildId: channel.guild.id }, 18 | async (err, data) => { 19 | if(!data) return; 20 | const antinuke = data.enabled.channels; 21 | const trusted = data.whitelist.channels.includes(executor.id); 22 | const owner = data.ownerLevel.includes(executor.id); 23 | 24 | if (executor.id === channel.guild.ownerId) return; 25 | if (executor.id === client.user.id) return; 26 | if (antinuke === false) return; 27 | if (trusted === true) return; 28 | if (owner === true) return; 29 | 30 | channel.delete(); 31 | const member = await channel.guild.members.fetch(executor.id); 32 | member.ban({ reason: "© Nityam Anti Channel Create" }); 33 | 34 | const logChannel = channel.guild.channels.cache.get(data.logChannel); 35 | if (logChannel) { 36 | logChannel.send({ 37 | embeds: [ 38 | new EmbedBuilder() 39 | .setColor(client.color) 40 | .setAuthor({ 41 | name: client.user.username, 42 | iconURL: client.user.displayAvatarURL(), 43 | }) 44 | .addFields( 45 | { 46 | name: "Category", 47 | value: `> Anti Channel Create`, 48 | }, 49 | { 50 | name: "Log Type", 51 | value: "> User Banned", 52 | }, 53 | { 54 | name: "User", 55 | value: `> ${executor} ${executor.id}`, 56 | }, 57 | { 58 | name: "Reason", 59 | value: `> Creating Channels`, 60 | } 61 | ) 62 | .setFooter({ text: `© Nityam Antinuke Logs` }) 63 | .setTimestamp(), 64 | ], 65 | }); 66 | } 67 | } 68 | ); 69 | }); 70 | 71 | client.on("channelDelete", async (channel) => { 72 | if(!channel.guild.members.me.permissions.has(PermissionFlagsBits.ViewAuditLog)) return; 73 | const auditlogs = await channel.guild.fetchAuditLogs({ 74 | type: AuditLogEvent.ChannelDelete, 75 | limit: 1, 76 | }); 77 | const logs = auditlogs.entries.first(); 78 | if(!logs) return; 79 | const { executor } = logs; 80 | 81 | await GuildSettings.findOne( 82 | { guildId: channel.guild.id }, 83 | async (err, data) => { 84 | if(!data) return; 85 | const antinuke = data.enabled.channels; 86 | const trusted = data.whitelist.channels.includes(executor.id); 87 | const owner = data.ownerLevel.includes(executor.id); 88 | 89 | if (executor.id === channel.guild.ownerId) return; 90 | if (executor.id === client.user.id) return; 91 | if (antinuke === false) return; 92 | if (trusted === true) return; 93 | if (owner === true) return; 94 | 95 | channel.clone(); 96 | 97 | const member = await channel.guild.members.fetch(executor.id); 98 | member.ban({ reason: "© Nityam Anti Channel Delete" }); 99 | 100 | const logChannel = channel.guild.channels.cache.get(data.logChannel); 101 | if (logChannel) { 102 | logChannel.send({ 103 | embeds: [ 104 | new EmbedBuilder() 105 | .setColor(client.color) 106 | .setAuthor({ 107 | name: client.user.username, 108 | iconURL: client.user.displayAvatarURL(), 109 | }) 110 | .addFields( 111 | { 112 | name: "Category", 113 | value: `> Anti Channel Delete`, 114 | }, 115 | { 116 | name: "Log Type", 117 | value: "> User Banned", 118 | }, 119 | { 120 | name: "User", 121 | value: `> ${executor} ${executor.id}`, 122 | }, 123 | { 124 | name: "Reason", 125 | value: `> Deleting Channels`, 126 | } 127 | ) 128 | .setFooter({ text: `© Nityam Antinuke Logs` }) 129 | .setTimestamp(), 130 | ], 131 | }); 132 | } 133 | } 134 | ); 135 | }); 136 | 137 | client.on("channelUpdate", async (o, n) => { 138 | if(!n.guild.members.me.permissions.has(PermissionFlagsBits.ViewAuditLog)) return; 139 | const auditlogs = await n.guild.fetchAuditLogs({ 140 | type: AuditLogEvent.ChannelUpdate, 141 | limit: 1, 142 | }); 143 | const logs = auditlogs.entries.first(); 144 | if(!logs) return; 145 | const { executor } = logs; 146 | 147 | await GuildSettings.findOne({ guildId: o.guild.id }, async (err, data) => { 148 | if(!data) return; 149 | const antinuke = data.enabled.channels; 150 | const trusted = data.whitelist.channels.includes(executor.id); 151 | const owner = data.ownerLevel.includes(executor.id); 152 | 153 | if (executor.id === o.guild.ownerId) return; 154 | if (executor.id === client.user.id) return; 155 | if (antinuke === false) return; 156 | if (trusted === true) return; 157 | if (owner === true) return; 158 | 159 | const oldName = o.name; 160 | const newName = n.name; 161 | 162 | const member = await n.guild.members.fetch(executor.id); 163 | member.ban({ reason: "© Nityam Anti Channel Update" }); 164 | 165 | const logChannel = channel.guild.channels.cache.get(data.logChannel); 166 | if (logChannel) { 167 | logChannel.send({ 168 | embeds: [ 169 | new EmbedBuilder() 170 | .setColor(client.color) 171 | .setAuthor({ 172 | name: client.user.username, 173 | iconURL: client.user.displayAvatarURL(), 174 | }) 175 | .addFields( 176 | { 177 | name: "Category", 178 | value: `> Anti Channel Update`, 179 | }, 180 | { 181 | name: "Log Type", 182 | value: "> User Banned", 183 | }, 184 | { 185 | name: "User", 186 | value: `> ${executor} ${executor.id}`, 187 | }, 188 | { 189 | name: "Reason", 190 | value: `> Updating Channels`, 191 | } 192 | ) 193 | .setFooter({ text: `© Nityam Antinuke Logs` }) 194 | .setTimestamp(), 195 | ], 196 | }); 197 | } 198 | 199 | if (oldName !== newName) { 200 | await n.edit({ 201 | name: oldName, 202 | }); 203 | } 204 | if (n.isText()) { 205 | const oldTopic = o.topic; 206 | const newTopic = n.topic; 207 | if (oldTopic !== newTopic) { 208 | await n.setTopic(oldTopic); 209 | } 210 | } 211 | }); 212 | }); 213 | 214 | //=================================== Anti Role Events ===================================// 215 | 216 | client.on("roleCreate", async (role) => { 217 | if(!role.guild.members.me.permissions.has(PermissionFlagsBits.ViewAuditLog)) return; 218 | const auditlogs = await role.guild.fetchAuditLogs({ 219 | type: AuditLogEvent.RoleCreate, 220 | limit: 1, 221 | }); 222 | const logs = auditlogs.entries.first(); 223 | if(!logs) return; 224 | const { executor } = logs; 225 | 226 | await GuildSettings.findOne( 227 | { guildId: role.guild.id }, 228 | async (err, data) => { 229 | if(!data) return; 230 | const antinuke = data.enabled.roles; 231 | const trusted = data.whitelist.roles.includes(executor.id); 232 | const owner = data.ownerLevel.includes(executor.id); 233 | 234 | if (executor.id === role.guild.ownerId) return; 235 | if (executor.id === client.user.id) return; 236 | if (antinuke === false) return; 237 | if (trusted === true) return; 238 | if (owner === true) return; 239 | 240 | role.delete(); 241 | const member = await role.guild.members.fetch(executor.id); 242 | member.ban({ reason: "© Nityam Anti Role Create" }); 243 | 244 | const logChannel = role.guild.channels.cache.get(data.logChannel); 245 | if (logChannel) { 246 | logChannel.send({ 247 | embeds: [ 248 | new EmbedBuilder() 249 | .setColor(client.color) 250 | .setAuthor({ 251 | name: client.user.username, 252 | iconURL: client.user.displayAvatarURL(), 253 | }) 254 | .addFields( 255 | { 256 | name: "Category", 257 | value: `> Anti Role Create`, 258 | }, 259 | { 260 | name: "Log Type", 261 | value: "> User Banned", 262 | }, 263 | { 264 | name: "User", 265 | value: `> ${executor} ${executor.id}`, 266 | }, 267 | { 268 | name: "Reason", 269 | value: `> Creating Roles`, 270 | } 271 | ) 272 | .setFooter({ text: `© Nityam Antinuke Logs` }) 273 | .setTimestamp(), 274 | ], 275 | }); 276 | } 277 | } 278 | ); 279 | }); 280 | 281 | client.on("roleUpdate", async (o, n) => { 282 | if(!n.guild.members.me.permissions.has(PermissionFlagsBits.ViewAuditLog)) return; 283 | const auditlogs = await n.guild.fetchAuditLogs({ 284 | type: AuditLogEvent.RoleUpdate, 285 | limit: 1, 286 | }); 287 | const logs = auditlogs.entries.first(); 288 | if(!logs) return; 289 | const { executor } = logs; 290 | 291 | await GuildSettings.findOne({ guildId: o.guild.id }, async (err, data) => { 292 | if(!data) return; 293 | const antinuke = data.enabled.roles; 294 | const trusted = data.whitelist.roles.includes(executor.id); 295 | const owner = data.ownerLevel.includes(executor.id); 296 | 297 | if (executor.id === n.guild.ownerId) return; 298 | if (executor.id === client.user.id) return; 299 | if (antinuke === false) return; 300 | if (trusted === true) return; 301 | if (owner === true) return; 302 | 303 | n.setPermissions(o.permissions); 304 | const member = await n.guild.members.fetch(executor.id); 305 | member.ban({ reason: "© Nityam Anti Role Update" }); 306 | 307 | const logChannel = role.guild.channels.cache.get(data.logChannel); 308 | if (logChannel) { 309 | logChannel.send({ 310 | embeds: [ 311 | new EmbedBuilder() 312 | .setColor(client.color) 313 | .setAuthor({ 314 | name: client.user.username, 315 | iconURL: client.user.displayAvatarURL(), 316 | }) 317 | .addFields( 318 | { 319 | name: "Category", 320 | value: `> Anti Role Update`, 321 | }, 322 | { 323 | name: "Log Type", 324 | value: "> User Banned", 325 | }, 326 | { 327 | name: "User", 328 | value: `> ${executor} ${executor.id}`, 329 | }, 330 | { 331 | name: "Reason", 332 | value: `> Updating Roles`, 333 | } 334 | ) 335 | .setFooter({ text: `© Nityam Antinuke Logs` }) 336 | .setTimestamp(), 337 | ], 338 | }); 339 | } 340 | }); 341 | }); 342 | 343 | client.on("roleDelete", async (role) => { 344 | if(!role.guild.members.me.permissions.has(PermissionFlagsBits.ViewAuditLog)) return; 345 | const auditlogs = await role.guild.fetchAuditLogs({ 346 | type: AuditLogEvent.RoleDelete, 347 | limit: 1, 348 | }); 349 | const logs = auditlogs.entries.first(); 350 | if(!logs) return; 351 | const { executor } = logs; 352 | 353 | await GuildSettings.findOne( 354 | { guildId: role.guild.id }, 355 | async (err, data) => { 356 | if(!data) return; 357 | const antinuke = data.enabled.roles; 358 | const trusted = data.whitelist.roles.includes(executor.id); 359 | const owner = data.ownerLevel.includes(executor.id); 360 | 361 | if (executor.id === role.guild.ownerId) return; 362 | if (executor.id === client.user.id) return; 363 | if (antinuke === false) return; 364 | if (trusted === true) return; 365 | if (owner === true) return; 366 | if (role.managed) return; 367 | 368 | role.guild.roles.create({ name: role.name, color: role.color }); 369 | const member = await role.guild.members.fetch(executor.id); 370 | member.ban({ reason: "© Nityam Anti Role Delete" }); 371 | 372 | const logChannel = role.guild.channels.cache.get(data.logChannel); 373 | if (logChannel) { 374 | logChannel.send({ 375 | embeds: [ 376 | new EmbedBuilder() 377 | .setColor(client.color) 378 | .setAuthor({ 379 | name: client.user.username, 380 | iconURL: client.user.displayAvatarURL(), 381 | }) 382 | .addFields( 383 | { 384 | name: "Category", 385 | value: `> Anti Role Delete`, 386 | }, 387 | { 388 | name: "Log Type", 389 | value: "> User Banned", 390 | }, 391 | { 392 | name: "User", 393 | value: `> ${executor} ${executor.id}`, 394 | }, 395 | { 396 | name: "Reason", 397 | value: `> Deleting Roles`, 398 | } 399 | ) 400 | .setFooter({ text: `© Nityam Antinuke Logs` }) 401 | .setTimestamp(), 402 | ], 403 | }); 404 | } 405 | } 406 | ); 407 | }); 408 | 409 | //=================================== Anti Member Events ===================================// 410 | client.on("guildMemberUpdate", async (o, n) => { 411 | if(!n.guild.members.me.permissions.has(PermissionFlagsBits.ViewAuditLog)) return; 412 | const auditLogs = await n.guild.fetchAuditLogs({ 413 | limit: 1, 414 | type: AuditLogEvent.MemberRoleUpdate, 415 | }); 416 | const logs = auditLogs.entries.first(); 417 | if(!logs) return; 418 | const { executor, target } = logs; 419 | 420 | await GuildSettings.findOne({ guildId: o.guild.id }, async (err, data) => { 421 | 422 | if(!data) return; 423 | const antinuke = data.enabled.roles; 424 | const trusted = data.whitelist.roles.includes(executor.id); 425 | const owner = data.ownerLevel.includes(executor.id); 426 | 427 | if (antinuke === false) return; 428 | if (trusted === true) return; 429 | if (owner === true) return; 430 | if (executor.id === client.user.id) return; 431 | if (executor.id === n.guild.ownerId) return; 432 | 433 | const oldRoles = o.roles; 434 | const newRoles = n.roles; 435 | 436 | if (oldRoles !== newRoles) { 437 | n.roles.set(o.roles.cache); 438 | } 439 | 440 | const member = await n.guild.members.fetch(executor.id); 441 | member.ban({ reason: "© Nityam Anti Member Role Update" }); 442 | 443 | const logChannel = role.guild.channels.cache.get(data.logChannel); 444 | if (logChannel) { 445 | logChannel.send({ 446 | embeds: [ 447 | new EmbedBuilder() 448 | .setColor(client.color) 449 | .setAuthor({ 450 | name: client.user.username, 451 | iconURL: client.user.displayAvatarURL(), 452 | }) 453 | .addFields( 454 | { 455 | name: "Category", 456 | value: `> Anti Member Role Update`, 457 | }, 458 | { 459 | name: "Log Type", 460 | value: "> User Banned", 461 | }, 462 | { 463 | name: "User", 464 | value: `> ${executor} ${executor.id}`, 465 | }, 466 | { 467 | name: "Reason", 468 | value: `> Updating Member Roles`, 469 | } 470 | ) 471 | .setFooter({ text: `© Nityam Antinuke Logs` }) 472 | .setTimestamp(), 473 | ], 474 | }); 475 | } 476 | }); 477 | }); 478 | 479 | //=================================== Anti Ban Events ===================================// 480 | client.on("guildBanAdd", async (member) => { 481 | if(!member.guild.members.me.permissions.has(PermissionFlagsBits.ViewAuditLog)) return; 482 | const auditLogs = await member.guild.fetchAuditLogs({ 483 | type: AuditLogEvent.MemberBanAdd, 484 | limit: 1, 485 | }); 486 | const logs = auditLogs.entries.first(); 487 | if(!logs) return; 488 | const { executor, target } = logs; 489 | 490 | await GuildSettings.findOne( 491 | { guildId: member.guild.id }, 492 | async (err, data) => { 493 | if(!data) return; 494 | const antinuke = data.enabled.bans; 495 | const trusted = data.whitelist.bans.includes(executor.id); 496 | const owner = data.ownerLevel.includes(executor.id); 497 | 498 | if (antinuke === false) return; 499 | if (trusted === true) return; 500 | if (member.id !== target.id) return; 501 | if (owner === true) return; 502 | if (executor.id === client.user.id) return; 503 | if (executor.id === member.guild.ownerId) return; 504 | 505 | const member2 = member.guild.members.fetch(executor.id); 506 | member2.ban({ reason: "© Nityam Anti Member Ban " }); 507 | 508 | const logChannel = member.guild.channels.cache.get(data.logChannel); 509 | if (logChannel) { 510 | logChannel.send({ 511 | embeds: [ 512 | new EmbedBuilder() 513 | .setColor(client.color) 514 | .setAuthor({ 515 | name: client.user.username, 516 | iconURL: client.user.displayAvatarURL(), 517 | }) 518 | .addFields( 519 | { 520 | name: "Category", 521 | value: `> Anti Member Ban`, 522 | }, 523 | { 524 | name: "Log Type", 525 | value: "> User Banned", 526 | }, 527 | { 528 | name: "User", 529 | value: `> ${executor} ${executor.id}`, 530 | }, 531 | { 532 | name: "Reason", 533 | value: "> Baning Members", 534 | }, 535 | { 536 | name: "Target", 537 | value: `> ${target} ${target.id}`, 538 | } 539 | ) 540 | .setFooter({ text: `© Nityam Antinuke Logs` }) 541 | .setTimestamp(), 542 | ], 543 | }); 544 | } 545 | } 546 | ); 547 | }); 548 | 549 | //=================================== Anti Kick Events ===================================// 550 | client.on("guildMemberRemove", async (member) => { 551 | if(!member.guild.members.me.permissions.has(PermissionFlagsBits.ViewAuditLog)) return; 552 | const auditLogs = await member.guild.fetchAuditLogs({ 553 | type: AuditLogEvent.MemberKick, 554 | limit: 1, 555 | }); 556 | const logs = auditLogs.entries.first(); 557 | if(!logs) return; 558 | const { executor, target } = logs; 559 | 560 | await GuildSettings.findOne( 561 | { guildId: member.guild.id }, 562 | async (err, data) => { 563 | if(!data) return; 564 | const antinuke = data.enabled.kicks; 565 | const trusted = data.whitelist.kicks.includes(executor.id); 566 | const owner = data.ownerLevel.includes(executor.id); 567 | 568 | if (executor.id === client.user.id) return; 569 | if (executor.id === member.guild.ownerId) return; 570 | if (antinuke === false) return; 571 | if (member.id !== target.id) return; 572 | if (trusted === true) return; 573 | if (owner === true) return; 574 | 575 | const member2 = member.guild.members.fetch(executor.id); 576 | member2.ban({ reason: "© Nityam Anti Member Kick " }); 577 | 578 | const logChannel = member.guild.channels.cache.get(data.logChannel); 579 | if (logChannel) { 580 | logChannel.send({ 581 | embeds: [ 582 | new EmbedBuilder() 583 | .setColor(client.color) 584 | .setAuthor({ 585 | name: client.user.username, 586 | iconURL: client.user.displayAvatarURL(), 587 | }) 588 | .addFields( 589 | { 590 | name: "Category", 591 | value: `> Anti Member Kick`, 592 | }, 593 | { 594 | name: "Log Type", 595 | value: "> User Banned", 596 | }, 597 | { 598 | name: "User", 599 | value: `> ${executor} ${executor.id}`, 600 | }, 601 | { 602 | name: "Reason", 603 | value: "> Kicking Members", 604 | }, 605 | { 606 | name: "Target", 607 | value: `> ${target} ${target.id}`, 608 | } 609 | ) 610 | .setFooter({ text: `© Nityam Antinuke Logs` }) 611 | .setTimestamp(), 612 | ], 613 | }); 614 | } 615 | } 616 | ); 617 | }); 618 | 619 | //=================================== Anti Bot Events ===================================// 620 | client.on("guildMemberAdd", async (member) => { 621 | if(!member.guild.members.me.permissions.has(PermissionFlagsBits.ViewAuditLog)) return; 622 | const auditLogs = await member.guild.fetchAuditLogs({ 623 | type: AuditLogEvent.BotAdd, 624 | limit: 1, 625 | }); 626 | const logs = auditLogs.entries.first(); 627 | if(!logs) return; 628 | const { executor, target } = logs; 629 | 630 | await GuildSettings.findOne( 631 | { guildId: member.guild.id }, 632 | async (err, data) => { 633 | if(!data) return; 634 | const antinuke = data.enabled.antibot; 635 | const trusted = data.whitelist.antibot.includes(executor.id); 636 | const owner = data.ownerLevel.includes(executor.id); 637 | 638 | if (executor.id === client.user.id) return; 639 | if (executor.id === member.guild.ownerId) return; 640 | if (antinuke === false) return; 641 | if (trusted === true) return; 642 | if (!target.bot) return; 643 | if (owner === true) return; 644 | if (target.id !== member.id) return; 645 | 646 | const member3 = member.guild.members.fetch(executor.id); 647 | member3.ban({ reason: "© Nityam Anti Bot Add " }); 648 | const member2 = member.guild.members.fetch(target.id); 649 | member2.ban({ reason: "© Nityam Anti Bot Add " }); 650 | 651 | const logChannel = member.guild.channels.cache.get(data.logChannel); 652 | if (logChannel) { 653 | logChannel.send({ 654 | embeds: [ 655 | new EmbedBuilder() 656 | .setColor(client.color) 657 | .setAuthor({ 658 | name: client.user.username, 659 | iconURL: client.user.displayAvatarURL(), 660 | }) 661 | .addFields( 662 | { 663 | name: "Category", 664 | value: `> Anti Bot Add`, 665 | }, 666 | { 667 | name: "Log Type", 668 | value: "> User Banned", 669 | }, 670 | { 671 | name: "User", 672 | value: `> ${executor} ${executor.id}`, 673 | }, 674 | { 675 | name: "Reason", 676 | value: "> Illegal Bot Add", 677 | }, 678 | { 679 | name: "Bot", 680 | value: `> ${target} ${target.id}`, 681 | } 682 | ) 683 | .setFooter({ text: `© Nityam Antinuke Logs` }) 684 | .setTimestamp(), 685 | ], 686 | }); 687 | } 688 | } 689 | ); 690 | }); 691 | 692 | //=================================== Anti Webhook Events ===================================// 693 | 694 | client.on("webhookUpdate", async (webhook) => { 695 | if(!webhook.guild.members.me.permissions.has(PermissionFlagsBits.ViewAuditLog)) return; 696 | const auditLog = await webhook.guild.fetchAuditLogs({ 697 | limit: 1, 698 | type: AuditLogEvent.WebhookUpdate, 699 | }); 700 | const logs = auditLog.entries.first(); 701 | if(!logs) return; 702 | const { executor } = logs; 703 | 704 | await GuildSettings.findOne( 705 | { guildId: webhook.guild.id }, 706 | async (err, data) => { 707 | if(!data) return; 708 | const antinuke = data.enabled.webhooks; 709 | const trusted = data.whitelist.webhooks.includes(executor.id); 710 | const owner = data.ownerLevel.includes(executor.id); 711 | 712 | if (antinuke === false) return; 713 | if (trusted === true) return; 714 | if (owner === true) return; 715 | if (executor.id === client.user.id) return; 716 | if (executor.id === webhook.guild.ownerId) return; 717 | 718 | const member = webhook.guild.members.fetch(executor.id); 719 | member.ban({ reason: "© Nityam Anti Webhook Update" }); 720 | 721 | const logChannel = webhook.guild.channels.cache.get(data.logChannel); 722 | if (logChannel) { 723 | logChannel.send({ 724 | embeds: [ 725 | new EmbedBuilder() 726 | .setColor(client.color) 727 | .setAuthor({ 728 | name: client.user.username, 729 | iconURL: client.user.displayAvatarURL(), 730 | }) 731 | .addFields( 732 | { 733 | name: "Category", 734 | value: `> Anti Webhook Update`, 735 | }, 736 | { 737 | name: "Log Type", 738 | value: "> User Banned", 739 | }, 740 | { 741 | name: "User", 742 | value: `> ${executor} ${executor.id}`, 743 | }, 744 | { 745 | name: "Reason", 746 | value: "> Updating Webhook", 747 | } 748 | ) 749 | .setFooter({ text: `© Nityam Antinuke Logs` }) 750 | .setTimestamp(), 751 | ], 752 | }); 753 | } 754 | } 755 | ); 756 | }); 757 | 758 | client.on("webhookUpdate", async (webhook) => { 759 | if(!webhook.guild.members.me.permissions.has(PermissionFlagsBits.ViewAuditLog)) return; 760 | const auditLog = await webhook.guild.fetchAuditLogs({ 761 | limit: 1, 762 | type: AuditLogEvent.WebhookCreate, 763 | }); 764 | const logs = auditLog.entries.first(); 765 | if(!logs) return; 766 | const { executor } = logs; 767 | 768 | await GuildSettings.findOne( 769 | { guildId: webhook.guild.id }, 770 | async (err, data) => { 771 | if(!data) return; 772 | const antinuke = data.enabled.webhooks; 773 | const trusted = data.whitelist.webhooks.includes(executor.id); 774 | const owner = data.ownerLevel.includes(executor.id); 775 | 776 | if (antinuke === false) return; 777 | if (trusted === true) return; 778 | if (owner === true) return; 779 | if (executor.id === client.user.id) return; 780 | if (executor.id === webhook.guild.ownerId) return; 781 | 782 | const member = webhook.guild.members.fetch(executor.id); 783 | member.ban({ reason: "© Nityam Anti Webhook Create" }); 784 | 785 | const logChannel = webhook.guild.channels.cache.get(data.logChannel); 786 | if (logChannel) { 787 | logChannel.send({ 788 | embeds: [ 789 | new EmbedBuilder() 790 | .setColor(client.color) 791 | .setAuthor({ 792 | name: client.user.username, 793 | iconURL: client.user.displayAvatarURL(), 794 | }) 795 | .addFields( 796 | { 797 | name: "Category", 798 | value: `> Anti Webhook Create`, 799 | }, 800 | { 801 | name: "Log Type", 802 | value: "> User Banned", 803 | }, 804 | { 805 | name: "User", 806 | value: `> ${executor} ${executor.id}`, 807 | }, 808 | { 809 | name: "Reason", 810 | value: "> Creating Webhooks", 811 | } 812 | ) 813 | .setFooter({ text: `© Nityam Antinuke Logs` }) 814 | .setTimestamp(), 815 | ], 816 | }); 817 | } 818 | } 819 | ); 820 | }); 821 | 822 | client.on("webhookUpdate", async (webhook) => { 823 | if(!webhook.guild.members.me.permissions.has(PermissionFlagsBits.ViewAuditLog)) return; 824 | const auditLog = await webhook.guild.fetchAuditLogs({ 825 | limit: 1, 826 | type: AuditLogEvent.WebhookDelete, 827 | }); 828 | const logs = auditLog.entries.first(); 829 | if(!logs) return; 830 | const { executor } = logs; 831 | 832 | await GuildSettings.findOne( 833 | { guildId: webhook.guild.id }, 834 | async (err, data) => { 835 | if(!data) return; 836 | const antinuke = data.enabled.webhooks; 837 | const trusted = data.whitelist.webhooks.includes(executor.id); 838 | const owner = data.ownerLevel.includes(executor.id); 839 | 840 | if (antinuke === false) return; 841 | if (trusted === true) return; 842 | if (owner === true) return; 843 | if (executor.id === client.user.id) return; 844 | if (executor.id === webhook.guild.ownerId) return; 845 | 846 | const member = webhook.guild.members.fetch(executor.id); 847 | member.ban({ reason: "© Nityam Anti Webhook Delete" }); 848 | 849 | const logChannel = webhook.guild.channels.cache.get(data.logChannel); 850 | if (logChannel) { 851 | logChannel.send({ 852 | embeds: [ 853 | new EmbedBuilder() 854 | .setColor(client.color) 855 | .setAuthor({ 856 | name: client.user.username, 857 | iconURL: client.user.displayAvatarURL(), 858 | }) 859 | .addFields( 860 | { 861 | name: "Category", 862 | value: `> Anti Webhook Delete`, 863 | }, 864 | { 865 | name: "Log Type", 866 | value: "> User Banned", 867 | }, 868 | { 869 | name: "User", 870 | value: `> ${executor} ${executor.id}`, 871 | }, 872 | { 873 | name: "Reason", 874 | value: "> © Nityam Anti Webhook Delete", 875 | } 876 | ) 877 | .setFooter({ text: `© Nityam Antinuke Logs` }) 878 | .setTimestamp(), 879 | ], 880 | }); 881 | } 882 | } 883 | ); 884 | }); 885 | 886 | //=================================== Anti Guild Update ===================================// 887 | client.on('guildUpdate', async (o, n) => { 888 | 889 | const auditLog = await o.fetchAuditLogs({ 890 | limit: 1, 891 | type: AuditLogEvent.GuildUpdate, 892 | }); 893 | 894 | const logs = auditLog.entries.first(); 895 | 896 | if (!logs) return; 897 | const { executor } = logs; 898 | 899 | await GuildSettings.findOne( 900 | { guildId: n.id }, 901 | async (err, data) => { 902 | if (!data) return; 903 | const antinuke = data.guildId; 904 | const trusted = data.whitelist.guildUpdate.includes(executor.id); 905 | const owner = data.ownerLevel.includes(executor.id); 906 | 907 | if (antinuke === false) return; 908 | if (trusted === true) return; 909 | if (owner === true) return; 910 | if (executor.id === client.user.id) return; 911 | 912 | const oldIcon = o.iconURL(); 913 | 914 | const oldName = o.name; 915 | 916 | const newIcon = n.iconURL(); 917 | const newName = n.name; 918 | 919 | if (oldName !== newName) { 920 | await n.setName(oldName); 921 | } 922 | 923 | if (oldIcon !== newIcon) { 924 | await o.setIcon(oldIcon); 925 | } 926 | 927 | const member = await n.guild.members.fetch(executor.id); 928 | member.ban({ reason: "© Nityam Anti Guild Update" }); 929 | const logChannel = webhook.guild.channels.cache.get(data.logChannel); 930 | if (logChannel) { 931 | logChannel.send({ 932 | embeds: [ 933 | new EmbedBuilder() 934 | .setColor(client.color) 935 | .setAuthor({ 936 | name: client.user.username, 937 | iconURL: client.user.displayAvatarURL(), 938 | }) 939 | .addFields( 940 | { 941 | name: "Category", 942 | value: `> Anti Guild Update`, 943 | }, 944 | { 945 | name: "Log Type", 946 | value: "> User Banned", 947 | }, 948 | { 949 | name: "User", 950 | value: `> ${executor} ${executor.id}`, 951 | }, 952 | { 953 | name: "Reason", 954 | value: "> © Nityam Anti Guild Update", 955 | } 956 | ) 957 | .setFooter({ text: `© Nityam Antinuke Logs` }) 958 | .setTimestamp(), 959 | ], 960 | }); 961 | } 962 | 963 | 964 | }) 965 | }); 966 | }; 967 | -------------------------------------------------------------------------------- /Handler/Command.js: -------------------------------------------------------------------------------- 1 | const chillout = require("chillout"); 2 | const readdirRecursive = require("recursive-readdir"); 3 | const { resolve, relative } = require("path"); 4 | const { green, white } = require('chalk'); 5 | 6 | module.exports = async (client) => { 7 | let interactionsPath = resolve("./commands"); 8 | let interactionFiles = await readdirRecursive(interactionsPath); 9 | 10 | await chillout.forEach(interactionFiles, (interactionFile) => { 11 | const start = Date.now(); 12 | const rltPath = relative(__dirname, interactionFile); 13 | // console.log(`[INFO] Loading interaction at.. "${interactionFile}"`) 14 | const command = require(interactionFile); 15 | 16 | if (command.name.length > 3) { 17 | console.log(`[WARN] "${rltPath}" The name list of the interaction file is too long. (>3) Skipping..`); 18 | return; 19 | } 20 | 21 | if (!command.name?.length) { 22 | console.log(`[WARN] "${rltPath}" The interaction file does not have a name. Skipping..`); 23 | return; 24 | } 25 | 26 | if (client.slash.has(command.name)) { 27 | console.log(`[WARN] "${command.name[1]}" interaction has already been installed. It's skipping.`) 28 | return; 29 | } 30 | 31 | client.slash.set(command.name, command); 32 | // console.log(`[INFO] "${command.type == "CHAT_INPUT" ? `/${command.name.join(" ")}` : `${command.name[0]}`}" ${command.name[1] || ""} ${command.name[2] || ""} The interaction has been uploaded. (it took ${Date.now() - start}ms)`); 33 | }); 34 | 35 | if (client.slash.size) { 36 | console.log(white('[') + green('INFO') + white('] ') + green(`${client.slash.size} `) + white('Interactions') + green(' Loaded!')); 37 | } else { 38 | console.log(`[WARN] No interactions loaded, is everything ok?`); 39 | } 40 | } -------------------------------------------------------------------------------- /Handler/Database.js: -------------------------------------------------------------------------------- 1 | const { white, green } = require("chalk"); 2 | 3 | module.exports = (client) => { 4 | require("./Database/Connect.js")(client); 5 | require("./Database/Premium.js")(client); 6 | console.log(white('[') + green('INFO') + white('] ') + green('Database ') + white('Events') + green(' Loaded!')); 7 | }; -------------------------------------------------------------------------------- /Handler/Database/Connect.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose'); 2 | const { MONGO_URI } = require("../../Settings/config") 3 | module.exports = async () => { 4 | try { 5 | await mongoose.connect(MONGO_URI, { 6 | useNewUrlParser: true, 7 | useUnifiedTopology: true, 8 | useFindAndModify: false, 9 | useCreateIndex: true, 10 | }) 11 | } catch (error) { 12 | console.log(error); 13 | } 14 | } -------------------------------------------------------------------------------- /Handler/Database/Premium.js: -------------------------------------------------------------------------------- 1 | const cron = require('node-cron') 2 | const Premium = require("../../Models/Premium"); 3 | 4 | module.exports = async (client) => { 5 | cron.schedule('*/60 * * * * *', async () => { 6 | await Premium.find({ isPremium: true }, async (err, users) => { 7 | if (users && users.length) { 8 | 9 | for (let user of users) { 10 | if (Date.now() >= user.premium.expiresAt) { 11 | 12 | user.isPremium = false 13 | user.premium.redeemedBy = [] 14 | user.premium.redeemedAt = null 15 | user.premium.expiresAt = null 16 | user.premium.plan = null 17 | 18 | const newUser = await user.save({ new: true }).catch(() => {}) 19 | client.premiums.set(newUser.Id, newUser) 20 | } 21 | } 22 | } 23 | }) 24 | }) 25 | } -------------------------------------------------------------------------------- /Handler/Events.js: -------------------------------------------------------------------------------- 1 | const { white, green } = require("chalk"); 2 | const { readdirSync } = require('fs'); 3 | 4 | module.exports = async (client) => { 5 | const loadcommand = dirs =>{ 6 | const events = readdirSync(`./Events/${dirs}/`).filter(d => d.endsWith('.js')); 7 | for (let file of events) { 8 | const evt = require(`../Events/${dirs}/${file}`); 9 | const eName = file.split('.')[0]; 10 | client.on(eName, evt.bind(null, client)); 11 | } 12 | }; 13 | ["Client", "Guild"].forEach((x) => loadcommand(x)); 14 | console.log(white('[') + green('INFO') + white('] ') + green('Event ') + white('Events') + green(' Loaded!')); 15 | }; -------------------------------------------------------------------------------- /Handler/errLogger.js: -------------------------------------------------------------------------------- 1 | const { EmbedBuilder, WebhookClient } = require("discord.js"); 2 | const { inspect } = require("util"); 3 | const config = require("../Settings/config") 4 | const webhook = new WebhookClient({ 5 | url: `${config.webhook.error}` 6 | }); 7 | 8 | module.exports = (client) => { 9 | const embed = new EmbedBuilder().setColor("Red"); 10 | 11 | client.on("error", (err) => { 12 | console.log(err); 13 | 14 | embed 15 | .setTitle("Discord API Error") 16 | .setURL("https://discordjs.guide/popular-topics/errors.html#api-errors") 17 | .setDescription( 18 | `\`\`\`${inspect(err, { depth: 0 }).slice(0, 1000)}\`\`\`` 19 | ) 20 | .setTimestamp(); 21 | 22 | return webhook.send({ embeds: [embed] }); 23 | }); 24 | 25 | process.on("unhandledRejection", (reason, promise) => { 26 | console.log(reason, "\n", promise); 27 | 28 | embed 29 | .setTitle("Unhandled Rejection/Catch") 30 | .setURL("https://nodejs.org/api/process.html#event-unhandledrejection") 31 | .addFields( 32 | { 33 | name: "Reason", 34 | value: `\`\`\`${inspect(reason, { depth: 0 }).slice(0, 1000)}\`\`\``, 35 | }, 36 | { 37 | name: "Promise", 38 | value: `\`\`\`${inspect(promise, { depth: 0 }).slice(0, 1000)}\`\`\``, 39 | } 40 | ) 41 | .setTimestamp(); 42 | 43 | return webhook.send({ embeds: [embed] }); 44 | }); 45 | 46 | process.on("uncaughtException", (err, origin) => { 47 | console.log(err, "\n", origin); 48 | 49 | embed 50 | .setTitle("Uncaught Exception/Catch") 51 | .setURL("https://nodejs.org/api/process.html#event-uncaughtexception") 52 | .addFields( 53 | { 54 | name: "Error", 55 | value: `\`\`\`${inspect(err, { depth: 0 }).slice(0, 1000)}\`\`\``, 56 | }, 57 | { 58 | name: "Origin", 59 | value: `\`\`\`${inspect(origin, { depth: 0 }).slice(0, 1000)}\`\`\``, 60 | } 61 | ) 62 | .setTimestamp(); 63 | 64 | return webhook.send({ embeds: [embed] }); 65 | }); 66 | 67 | process.on("uncaughtExceptionMonitor", (err, origin) => { 68 | console.log(err, "\n", origin); 69 | 70 | embed 71 | .setTitle("Uncaught Exception Monitor") 72 | .setURL( 73 | "https://nodejs.org/api/process.html#event-uncaughtexceptionmonitor" 74 | ) 75 | .addFields( 76 | { 77 | name: "Error", 78 | value: `\`\`\`${inspect(err, { depth: 0 }).slice(0, 1000)}\`\`\``, 79 | }, 80 | { 81 | name: "Origin", 82 | value: `\`\`\`${inspect(origin, { depth: 0 }).slice(0, 1000)}\`\`\``, 83 | } 84 | ) 85 | .setTimestamp(); 86 | 87 | return webhook.send({ embeds: [embed] }); 88 | }); 89 | 90 | process.on("warning", (warn) => { 91 | console.log(warn); 92 | 93 | embed 94 | .setTitle("Uncaught Exception Monitor Warning") 95 | .setURL("https://nodejs.org/api/process.html#event-warning") 96 | .addFields({ 97 | name: "Warning", 98 | value: `\`\`\`${inspect(warn, { depth: 0 }).slice(0, 1000)}\`\`\``, 99 | }) 100 | .setTimestamp(); 101 | 102 | return webhook.send({ embeds: [embed] }); 103 | }); 104 | }; -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 - 2024 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Models/Antinuke.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose'); 2 | 3 | const guildSettingsSchema = new mongoose.Schema({ 4 | guildId: { type: String, required: true, unique: true }, 5 | whitelist: { 6 | roles: [{ type: String }], 7 | channels: [{ type: String }], 8 | webhooks: [{ type: String }], 9 | kicks: [{ type: String }], 10 | bans: [{ type: String }], 11 | antibot: [{ type: String }], 12 | guildUpdate: [{ type: String }] 13 | }, 14 | actions: [{ 15 | userId: { type: String, required: true }, 16 | category: { type: String, enum: ['roles', 'channels', 'webhooks', 'kicks', 'bans', 'antibot', 'guildUpdate'], required: true }, 17 | timestamp: { type: Date, default: Date.now }, 18 | }], 19 | logChannel: { type: String, default: null }, 20 | enabled: { 21 | roles: { type: Boolean, default: false }, 22 | channels: { type: Boolean, default: false }, 23 | webhooks: { type: Boolean, default: false }, 24 | kicks: { type: Boolean, default: false }, 25 | bans: { type: Boolean, default: false }, 26 | antibot: { type: Boolean, default: false }, 27 | guildUpdate: { type: Boolean, default: false } 28 | }, 29 | ownerLevel: [{ type: String, default: null }], 30 | }); 31 | 32 | module.exports = mongoose.model('GuildSettings4', guildSettingsSchema); 33 | -------------------------------------------------------------------------------- /Models/Premium.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose') 2 | 3 | const CreatePremium = mongoose.Schema({ 4 | Id: { 5 | type: String, 6 | required: true, 7 | unique: true 8 | }, 9 | isPremium: { 10 | type: Boolean, 11 | default: false 12 | }, 13 | premium: { 14 | redeemedBy: { 15 | type: Array, 16 | default: null 17 | }, 18 | redeemedAt: { 19 | type: Number, 20 | default: null 21 | }, 22 | expiresAt: { 23 | type: Number, 24 | default: null 25 | }, 26 | plan: { 27 | type: String, 28 | default: null 29 | } 30 | } 31 | }) 32 | module.exports = mongoose.model('Premium', CreatePremium) -------------------------------------------------------------------------------- /Models/Redeem.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose') 2 | 3 | const CreateRedeem = mongoose.Schema({ 4 | code: { 5 | type: String, 6 | default: null 7 | }, 8 | expiresAt: { 9 | type: Number, 10 | default: null 11 | }, 12 | plan: { 13 | type: String, 14 | default: null 15 | } 16 | }) 17 | 18 | module.exports = mongoose.model('Redeem', CreateRedeem) -------------------------------------------------------------------------------- /Readme.md: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 |
7 |
8 |
9 |
10 |
to redeem!`, iconURL: interaction.user.displayAvatarURL() })
104 |
105 | interaction.editReply({ embeds: [embed] })
106 | },
107 | };
108 |
--------------------------------------------------------------------------------
/commands/Premium/redeem.js:
--------------------------------------------------------------------------------
1 | const {
2 | ApplicationCommandOptionType,
3 | ChannelType,
4 | EmbedBuilder,
5 | PermissionFlagsBits,
6 | } = require("discord.js");
7 | const moment = require('moment');
8 | const Premium = require("../../Models/Premium");
9 | const Redeem = require("../../Models/Redeem");
10 |
11 | module.exports = {
12 | name: ["redeem"],
13 | description: "redeem a premium by the code",
14 | category: "Premium",
15 | options: [
16 | {
17 | name: "code",
18 | description: "the code generated by owner",
19 | type: ApplicationCommandOptionType.String,
20 | required: true
21 | }
22 | ],
23 | permissions: {
24 | channel: [],
25 | bot: [],
26 | user: [],
27 | },
28 | settings: {
29 | isPremium: false,
30 | isOwner: false,
31 | inVoice: false,
32 | isNSFW: false,
33 | },
34 | run: async (interaction, client) => {
35 |
36 | await interaction.deferReply({ ephemeral: false });
37 |
38 | const input = interaction.options.getString("code");
39 |
40 | let member = await Premium.findOne({ Id: interaction.user.id })
41 |
42 | if (member && member.isPremium) {
43 | const embed = new EmbedBuilder()
44 | .setColor(client.color)
45 | .setDescription(`You Already Have Premium Enjoy That`)
46 | return interaction.editReply({ embeds: [embed] });
47 | } else {
48 |
49 | const premium = await Redeem.findOne({ code: input.toUpperCase() });
50 | if (premium) {
51 | const expires = moment(premium.expiresAt).format('do/MMMM/YYYY (HH:mm:ss)')
52 |
53 | const member2 = new Premium({ Id: interaction.user.id})
54 | member2.isPremium = true
55 | member2.premium.redeemedBy.push(interaction.user)
56 | member2.premium.redeemedAt = Date.now()
57 | member2.premium.expiresAt = premium.expiresAt
58 | member2.premium.plan = premium.plan
59 |
60 | member = await member2.save({ new: true });
61 | client.premiums.set(interaction.user.id, member);
62 | await premium.deleteOne();
63 |
64 | const embed = new EmbedBuilder()
65 | .setAuthor({ name: `Redeemed Code`, iconURL: client.user.displayAvatarURL() })
66 | .setDescription(`**Plan**: \`${premium.plan}\`\n**Expires At**: \`${expires}\``)
67 | .setColor(client.color)
68 | .setTimestamp()
69 |
70 | return interaction.editReply({ embeds: [embed] });
71 | } else {
72 | const embed = new EmbedBuilder()
73 | .setColor(client.color)
74 | .setDescription(`That Redeem code is invalid`)
75 | return interaction.editReply({ embeds: [embed] })
76 | }
77 | }
78 | },
79 | };
--------------------------------------------------------------------------------
/commands/Premium/remove.js:
--------------------------------------------------------------------------------
1 | const {
2 | ApplicationCommandOptionType,
3 | ChannelType,
4 | EmbedBuilder,
5 | PermissionFlagsBits,
6 | } = require("discord.js");
7 | const Premium = require("../../Models/Premium")
8 | module.exports = {
9 | name: ["premium", "remove"],
10 | description: "Remove Premium From A User",
11 | category: "Premium",
12 | options: [
13 | {
14 | name: "target",
15 | description: "Mention a user want to remove!",
16 | required: true,
17 | type: ApplicationCommandOptionType.User,
18 | }
19 | ],
20 | permissions: {
21 | channel: [],
22 | bot: [],
23 | user: [],
24 | },
25 | settings: {
26 | isPremium: false,
27 | isOwner: false,
28 | inVoice: false,
29 | isNSFW: false,
30 | },
31 | run: async (interaction, client) => {
32 |
33 | await interaction.deferReply({ ephemeral: false });
34 |
35 | const mentions = interaction.options.getUser("target");
36 |
37 | const db = await Premium.findOne({ Id: mentions.id });
38 |
39 | if (db.isPremium) {
40 | db.isPremium = false
41 | db.premium.redeemedBy = []
42 | db.premium.redeemedAt = null
43 | db.premium.expiresAt = null
44 | db.premium.plan = null
45 |
46 | const newUser = await db.save({ new: true }).catch(() => {})
47 | client.premiums.set(newUser.Id, newUser);
48 |
49 | const embed = new EmbedBuilder()
50 | .setDescription(`Successfully Removed The Premium From ${mentions}`)
51 | .setColor(client.color)
52 |
53 | interaction.editReply({ embeds: [embed] });
54 |
55 | } else {
56 | const embed = new EmbedBuilder()
57 | .setDescription(`That User Not Have Premium`)
58 | .setColor(client.color)
59 |
60 | interaction.editReply({ embeds: [embed] });
61 | }
62 |
63 | },
64 | };
65 |
--------------------------------------------------------------------------------
/commands/Utility/help.js:
--------------------------------------------------------------------------------
1 | const {StringSelectMenuBuilder, StringSelectMenuOptionBuilder, EmbedBuilder, ActionRowBuilder, } = require("discord.js");
2 | const { readdirSync } = require("fs");
3 | module.exports = {
4 | name: ["help"],
5 | description: "get info about the all commands available",
6 | category: "Utility",
7 | options: [],
8 | permissions: {
9 | channel: [],
10 | bot: [],
11 | user: [],
12 | },
13 | settings: {
14 | isPremium: false,
15 | isOwner: false,
16 | inVoice: false,
17 | isNSFW: false,
18 | },
19 | run: async (interaction, client) => {
20 | await interaction.deferReply({ ephemeral: false });
21 |
22 | const categories = readdirSync("./commands/")
23 |
24 | const embed = new EmbedBuilder()
25 | .setColor(client.color)
26 | .setDescription(`Please Select Category Menu!`)
27 |
28 | const row = new ActionRowBuilder()
29 | .addComponents([
30 | new StringSelectMenuBuilder()
31 | .setCustomId("help-category")
32 | .setPlaceholder(`Please Select Category Menu!`)
33 | .setMaxValues(1)
34 | .setMinValues(1)
35 | /// Map the categories to the select menu
36 | .setOptions(categories.map(category => {
37 | return new StringSelectMenuOptionBuilder()
38 | .setLabel(category)
39 | .setValue(category)
40 | }
41 | ))
42 | ])
43 |
44 | interaction.editReply({ embeds: [embed], components: [row] }).then(async (msg) => {
45 | let filter = (i) => (i.isStringSelectMenu()) && i.user && i.message.author.id == client.user.id;
46 | let collector = await msg.createMessageComponentCollector({
47 | filter,
48 | time: 90000
49 | });
50 | collector.on('collect', async (m) => {
51 | if(m.isStringSelectMenu()) {
52 | if(m.customId === "help-category") {
53 | await m.deferUpdate();
54 | let [directory] = m.values;
55 |
56 | const embed = new EmbedBuilder()
57 | .setAuthor({ name: `${interaction.guild.members.me.displayName} Help Command!`, iconURL: interaction.guild.iconURL({ dynamic: true })})
58 | .setDescription(`The bot prefix is: \`/\``)
59 | .setThumbnail(client.user.displayAvatarURL({ dynamic: true, size: 2048 }))
60 | .setColor(client.color)
61 | .addFields({ name: `❯ ${directory.toUpperCase()} [${client.slash.filter(c => c.category === directory).size}]`, value: `${client.slash.filter(c => c.category === directory).map(c => `\`${c.name.at(-1)}\``).join(", ")}`, inline: false })
62 | .setFooter({ text: `© ${interaction.guild.members.me.displayName} | Total Commands: ${client.slash.size}`, iconURL: client.user.displayAvatarURL({ dynamic: true })})
63 |
64 | msg.edit({ embeds: [embed] });
65 | }
66 | }
67 | });
68 |
69 | collector.on('end', async (collected, reason) => {
70 | if(reason === 'time') {
71 | const timed = new EmbedBuilder()
72 | .setDescription(`Help Menu timed out try using /help again.`)
73 | .setColor(client.color)
74 |
75 | msg.edit({ embeds: [timed], components: [] });
76 | }
77 | });
78 | })
79 | },
80 | };
81 |
--------------------------------------------------------------------------------
/commands/Utility/ping.js:
--------------------------------------------------------------------------------
1 | const {
2 | ApplicationCommandOptionType,
3 | ChannelType,
4 | EmbedBuilder,
5 | PermissionFlagsBits,
6 | } = require("discord.js");
7 | module.exports = {
8 | name: ["ping"],
9 | description: "check the ping of the bot",
10 | category: "Utility",
11 | options: [],
12 | permissions: {
13 | channel: [],
14 | bot: [],
15 | user: [],
16 | },
17 | settings: {
18 | isPremium: false,
19 | isOwner: false,
20 | inVoice: false,
21 | isNSFW: false,
22 | },
23 | run: async (interaction, client) => {
24 | interaction.reply({ content: `Ping: \`${client.ws.ping}\``})
25 | },
26 | };
27 |
--------------------------------------------------------------------------------
/deploySlash.js:
--------------------------------------------------------------------------------
1 | const { plsParseArgs } = require('plsargs');
2 | const args = plsParseArgs(process.argv.slice(2));
3 | const chillout = require("chillout");
4 | const { makeSureFolderExists } = require("stuffs");
5 | const path = require("path");
6 | const readdirRecursive = require("recursive-readdir");
7 | const { TOKEN } = require("./Settings/config.js");
8 | const { ApplicationCommandOptionType, REST, Routes, ApplicationCommandManager } = require('discord.js');
9 |
10 | (async () => {
11 |
12 | let command = [];
13 |
14 | let cleared = args.get(0) == "guild" ? args.get(2) == "clear" : (args.get(0) == "global" ? args.get(1) == "clear" : false);
15 | let deployed = args.get(0) == "guild" ? "guild" : args.get(0) == "global" ? "global" : null;
16 |
17 | if (!deployed) {
18 | console.error(`Invalid sharing mode! Valid modes: guild, global`);
19 | console.error(`Usage example: node deploySlash.js guild [clear]`);
20 | console.error(`Usage example: node deploySlash.js global [clear]`);
21 | return process.exit(1);
22 | }
23 |
24 | if (!cleared) {
25 | let interactionsFolder = path.resolve("./commands");
26 |
27 | await makeSureFolderExists(interactionsFolder);
28 |
29 | let store = [];
30 |
31 | console.log("Reading interaction files..")
32 |
33 | let interactionFilePaths = await readdirRecursive(interactionsFolder);
34 | interactionFilePaths = interactionFilePaths.filter(i => {
35 | let state = path.basename(i).startsWith("-");
36 | return !state;
37 | });
38 |
39 | await chillout.forEach(interactionFilePaths, (interactionFilePath) => {
40 | const cmd = require(interactionFilePath);
41 | console.log(`Interaction "${cmd.type == "CHAT_INPUT" ? `/${cmd.name.join(" ")}` : `${cmd.name[0]}`}" ${cmd.name[1] || ""} ${cmd.name[2] || ""} added to the transform list!`);
42 | store.push(cmd);
43 | });
44 |
45 | store = store.sort((a, b) => a.name.length - b.name.length)
46 |
47 | command = store.reduce((all, current) => {
48 | switch (current.name.length) {
49 | case 1: {
50 | all.push({
51 | type: current.type,
52 | name: current.name[0],
53 | description: current.description,
54 | defaultPermission: current.defaultPermission,
55 | options: current.options
56 | });
57 | break;
58 | }
59 | case 2: {
60 | let baseItem = all.find((i) => {
61 | return i.name == current.name[0] && i.type == current.type
62 | });
63 | if (!baseItem) {
64 | all.push({
65 | type: current.type,
66 | name: current.name[0],
67 | description: `${current.name[0]} commands.`,
68 | defaultPermission: current.defaultPermission,
69 | options: [
70 | {
71 | type: ApplicationCommandOptionType.Subcommand,
72 | description: current.description,
73 | name: current.name[1],
74 | options: current.options
75 | }
76 | ]
77 | });
78 | } else {
79 | baseItem.options.push({
80 | type: ApplicationCommandOptionType.Subcommand,
81 | description: current.description,
82 | name: current.name[1],
83 | options: current.options
84 | })
85 | }
86 | break;
87 | }
88 | case 3: {
89 | let SubItem = all.find((i) => {
90 | return i.name == current.name[0] && i.type == current.type
91 | });
92 | if (!SubItem) {
93 | all.push({
94 | type: current.type,
95 | name: current.name[0],
96 | description: `${current.name[0]} commands.`,
97 | defaultPermission: current.defaultPermission,
98 | options: [
99 | {
100 | type: ApplicationCommandOptionType.SubcommandGroup,
101 | description: `${current.name[1]} commands.`,
102 | name: current.name[1],
103 | options: [
104 | {
105 | type: ApplicationCommandOptionType.Subcommand,
106 | description: current.description,
107 | name: current.name[2],
108 | options: current.options
109 | }
110 | ]
111 | }
112 | ]
113 | });
114 | } else {
115 | let GroupItem = SubItem.options.find(i => {
116 | return i.name == current.name[1] && i.type == ApplicationCommandOptionType.SubcommandGroup
117 | });
118 | if (!GroupItem) {
119 | SubItem.options.push({
120 | type: ApplicationCommandOptionType.SubcommandGroup,
121 | description: `${current.name[1]} commands.`,
122 | name: current.name[1],
123 | options: [
124 | {
125 | type: ApplicationCommandOptionType.Subcommand,
126 | description: current.description,
127 | name: current.name[2],
128 | options: current.options
129 | }
130 | ]
131 | })
132 | } else {
133 | GroupItem.options.push({
134 | type: ApplicationCommandOptionType.Subcommand,
135 | description: current.description,
136 | name: current.name[2],
137 | options: current.options
138 | })
139 | }
140 | }
141 | }
142 | break;
143 | }
144 |
145 | return all;
146 | }, []);
147 |
148 | command = command.map(i => ApplicationCommandManager.transformCommand(i));
149 | } else {
150 | console.info("No interactions read, all existing ones will be cleared...");
151 | }
152 |
153 | const rest = new REST({ version: "9" }).setToken(TOKEN);
154 | const client = await rest.get(Routes.user());
155 | console.info(`Account information received! ${client.username}#${client.discriminator} (${client.id})`);
156 |
157 | console.info(`Interactions are posted on discord!`);
158 | switch (deployed) {
159 | case "guild": {
160 | let guildId = args.get(1);
161 | console.info(`Deploy mode: guild (${guildId})`);
162 |
163 | await rest.put(Routes.applicationGuildCommands(client.id, guildId), { body: command });
164 |
165 | console.info(`Shared commands may take 3-5 seconds to arrive.`);
166 | break;
167 | }
168 | case "global": {
169 | console.info(`Deploy mode: global`);
170 |
171 | await rest.put(Routes.applicationCommands(client.id), { body: command });
172 |
173 | console.info(`Shared commands can take up to 1 hour to arrive. If you want it to come immediately, you can throw your bot from your server and get it back.`);
174 | break;
175 | }
176 | }
177 |
178 | console.info(`Interactions shared!`);
179 | })();
180 |
181 | /// Credit https://github.com/akanora/Youtube-Together (Handler) || Edit by: https://github.com/Adivise
--------------------------------------------------------------------------------
/example.env:
--------------------------------------------------------------------------------
1 | error=
2 | join=
3 | leave=
4 |
5 | TOKEN=
6 | MONGO_URI=
7 | EMBED_COLOR=
8 | DEV_ID=
9 | OWNER_ID=
--------------------------------------------------------------------------------
/index.js:
--------------------------------------------------------------------------------
1 | const MainClient = require("./bot.js");
2 | const client = new MainClient();
3 |
4 | client.connect()
5 |
6 | module.exports = client;
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "antinuke",
3 | "version": "1.3.0",
4 | "description": "Best Discord Antinuke Bot With MongoDB Join Discord: https://link6090.ml/yashoda",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "node --no-warnings .",
8 | "start": "node --no-warnings index.js"
9 | },
10 | "repository": {
11 | "type": "git",
12 | "url": "git+https://github.com/grdAyush/Antinuke-bot.git"
13 | },
14 | "keywords": [
15 | "discord.js",
16 | "discord.jsv14",
17 | "v14",
18 | "discord",
19 | "discord.js@14",
20 | "best antinuke",
21 | "discord bot antinuke",
22 | "security bot",
23 | "antinuke security",
24 | "anti wizz bot"
25 | ],
26 | "author": "grdAyush",
27 | "license": "ISC",
28 | "bugs": {
29 | "url": "https://github.com/grdAyush/Antinuke-bot/issues"
30 | },
31 | "homepage": "https://github.com/grdAyush/Antinuke-bot#readme",
32 | "dependencies": {
33 | "chalk": "^4.1.0",
34 | "chillout": "^5.0.0",
35 | "discord.js": "^14.9.0",
36 | "dotenv": "^16.0.3",
37 | "fs": "^0.0.1-security",
38 | "moment": "^2.29.4",
39 | "moment-duration-format": "^2.3.2",
40 | "mongoose": "^5.9.19",
41 | "node-cron": "^3.0.2",
42 | "path": "^0.12.7",
43 | "plsargs": "^0.1.6",
44 | "recursive-readdir": "^2.2.3",
45 | "stuffs": "^0.1.27",
46 | "voucher-code-generator": "^1.3.0"
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/shards.js:
--------------------------------------------------------------------------------
1 | const { ShardingManager } = require('discord.js'); //imports the sharding manager
2 | require("dotenv").config();
3 |
4 | const manager = new ShardingManager('./index.js', {
5 | token: process.env.TOKEN || "", //paste your token here
6 | respawn: true,
7 | autoSpawn: true,
8 | totalShards: 1, //amount of shards
9 | shardList: "auto", //edit it only if you know what are you doing
10 | });
11 |
12 | manager.spawn({ amount: manager.totalShards, delay: null, timeout: -1 }).then((shards) => {
13 | console.log(`[CLIENT] ${shards.size} shard(s) spawned.`);
14 | }).catch((err) => {
15 | console.log("[CLIENT] An error has occurred :", err);
16 | });
17 |
18 | manager.on("shardCreate", (shard) => {
19 | shard.on("ready", () => {
20 | console.log(`[CLIENT] Shard ${shard.id} connected`);
21 | });
22 | });
--------------------------------------------------------------------------------