├── .gitattributes ├── src ├── Events │ ├── Distube │ │ ├── noRelated.js │ │ ├── finish.js │ │ ├── searchNoResult.js │ │ ├── error.js │ │ ├── playSong.js │ │ ├── addList.js │ │ └── addSong.js │ └── Client │ │ ├── roleDelete.js │ │ ├── stickerCreate.js │ │ ├── stickerDelete.js │ │ ├── roleCreate.js │ │ ├── roleUpdate.js │ │ ├── guildBanAdd.js │ │ ├── emojiDelete.js │ │ ├── guildBanRemove.js │ │ ├── channelDelete.js │ │ ├── emojiCreate.js │ │ ├── guildMemberRemove.js │ │ ├── voiceStateUpdate.js │ │ ├── guildScheduledEventDelete.js │ │ ├── guildMemberUpdate.js │ │ ├── guildMemberAdd.js │ │ ├── guildScheduledEventCreate.js │ │ ├── channelCreate.js │ │ ├── messageReactionRemove.js │ │ ├── userUpdate.js │ │ ├── channelUpdate.js │ │ └── messageReactionAdd.js ├── .env-template ├── Commands │ ├── Text │ │ ├── For_everyone │ │ │ ├── cockroach.js │ │ │ ├── chalk.js │ │ │ ├── good.js │ │ │ └── bigcock.js │ │ ├── For_mez │ │ │ ├── clearcmd.js │ │ │ ├── bad.js │ │ │ ├── crashboomer.js │ │ │ ├── move.js │ │ │ ├── embed2.js │ │ │ ├── ticket.js │ │ │ └── embed.js │ │ └── For_vmezchoc │ │ │ └── s.js │ └── Interaction │ │ ├── Fun │ │ ├── flag.js │ │ ├── catsay.js │ │ ├── pp.js │ │ ├── imagetotext.js │ │ ├── meme.js │ │ ├── 8ball.js │ │ ├── stopspam.js │ │ ├── spam.js │ │ ├── urban.js │ │ ├── hack.js │ │ ├── rps.js │ │ ├── text.js │ │ ├── pokemon.js │ │ └── animegirl.js │ │ ├── Context │ │ ├── Avatar.js │ │ ├── Translate.js │ │ ├── Info.js │ │ └── ImageSauce.js │ │ ├── Utilities │ │ ├── diceroll.js │ │ ├── number.js │ │ ├── dm.js │ │ ├── color.js │ │ ├── choose.js │ │ ├── timer.js │ │ └── role.js │ │ ├── Info │ │ ├── systems.js │ │ ├── roleinfo.js │ │ ├── ping.js │ │ ├── docs.js │ │ ├── weather.js │ │ ├── rank.js │ │ └── dialect.js │ │ ├── Waifus │ │ ├── waifu.js │ │ ├── breakup.js │ │ └── balls.js │ │ ├── Economy │ │ ├── balance.js │ │ ├── daily.js │ │ ├── withdraw.js │ │ ├── deposit.js │ │ ├── inventory.js │ │ ├── pay.js │ │ ├── shop.js │ │ └── beg.js │ │ ├── Music │ │ ├── autoplay.js │ │ ├── pause.js │ │ ├── resume.js │ │ ├── shuffle.js │ │ ├── skipto.js │ │ ├── seek.js │ │ ├── remove.js │ │ ├── loop.js │ │ ├── previous.js │ │ ├── skip.js │ │ ├── stop.js │ │ └── queue.js │ │ ├── Government │ │ ├── voting.js │ │ ├── crazysuppress.js │ │ └── clear.js │ │ ├── Admins │ │ ├── say.js │ │ └── systemstoggle.js │ │ └── mezmer420 │ │ └── setpresence.js ├── Utilities │ ├── court-recorder.js │ ├── dm.js │ ├── channel-messages-delete.js │ ├── counting.js │ ├── crazy-suppress.js │ ├── dead-chat.js │ ├── message-filter.js │ ├── birthdays.js │ ├── xp.js │ └── anti-crash.js ├── Event_handlers │ ├── handleDistubeEvents.js │ └── handleClientEvents.js ├── blacklisted-channels-and-categories.js ├── client.distube.js ├── index.js ├── package.json ├── text-command-handler.js └── commands-register.js ├── README.md └── .gitignore /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /src/Events/Distube/noRelated.js: -------------------------------------------------------------------------------- 1 | const { EmbedBuilder } = require("discord.js") 2 | 3 | module.exports = { 4 | name: "noRelated", 5 | async run(client, queue, defaultColor) { 6 | console.log("noRelated") 7 | }, 8 | } 9 | -------------------------------------------------------------------------------- /src/.env-template: -------------------------------------------------------------------------------- 1 | token= 2 | 3 | derpibooruAPItoken= 4 | openWeatherMapAPIKey= 5 | 6 | openAIOrganizationId= 7 | openAIKey= 8 | 9 | youtubeCookie= 10 | 11 | defaultColor= 12 | 13 | logChannel= 14 | announcementsChannel= -------------------------------------------------------------------------------- /src/Commands/Text/For_everyone/cockroach.js: -------------------------------------------------------------------------------- 1 | module.exports.run = async (client, message, args) => { 2 | message.channel 3 | .send( 4 | "https://i.pinimg.com/originals/a6/c7/7c/a6c77c6148c6f62354f07a1749685b65.gif" 5 | ) 6 | .catch((err) => { 7 | console.log(err) 8 | }) 9 | } 10 | -------------------------------------------------------------------------------- /src/Commands/Text/For_everyone/chalk.js: -------------------------------------------------------------------------------- 1 | module.exports.run = async (client, message, args) => { 2 | await message.channel.send("<@826841451945787412>").catch((err) => { 3 | console.log(err) 4 | }) 5 | 6 | message.channel 7 | .send( 8 | "https://tenor.com/view/groundhog-chicken-chalken-chalk-gh-gif-21808428" 9 | ) 10 | .catch((err) => { 11 | console.log(err) 12 | }) 13 | } 14 | -------------------------------------------------------------------------------- /src/Utilities/court-recorder.js: -------------------------------------------------------------------------------- 1 | const { ChannelType } = require("discord.js") 2 | 3 | module.exports.run = async ({ client }) => { 4 | // client.on("messageCreate", async (message) => { 5 | // if (message.channel.type === ChannelType.DM) return 6 | // if (message.channel.id !== "939675256765939863") return 7 | 8 | // console.log(`${message.author.username}: ${message.content}`) 9 | // }) 10 | } 11 | -------------------------------------------------------------------------------- /src/Commands/Text/For_everyone/good.js: -------------------------------------------------------------------------------- 1 | function sleep(ms) { 2 | return new Promise((resolve) => setTimeout(resolve, ms)) 3 | } 4 | 5 | module.exports.run = async (client, message, args) => { 6 | message.channel.sendTyping().catch((err) => { 7 | console.log(err) 8 | }) 9 | 10 | await sleep(Math.floor(Math.random() * 0) + 1001) 11 | 12 | message.channel.send(">;)").catch((err) => { 13 | console.log(err) 14 | }) 15 | } 16 | -------------------------------------------------------------------------------- /src/Events/Client/roleDelete.js: -------------------------------------------------------------------------------- 1 | const { EmbedBuilder } = require("discord.js") 2 | 3 | module.exports = { 4 | name: "roleDelete", 5 | async run(client, role, defaultColor, logChannel) { 6 | const logs = await client.channels.cache.get(logChannel) 7 | 8 | const embed = new EmbedBuilder() 9 | .setTitle("👋 Role Deleted") 10 | .setDescription(`Role Name: **${role.name}**`) 11 | .setColor(defaultColor) 12 | .setTimestamp() 13 | 14 | logs.send({ 15 | embeds: [embed], 16 | }).catch((err) => { 17 | console.log(err) 18 | }) 19 | }, 20 | } 21 | -------------------------------------------------------------------------------- /src/Commands/Text/For_mez/clearcmd.js: -------------------------------------------------------------------------------- 1 | const wait = require("node:timers/promises").setTimeout 2 | const clear = require("clear-screen") 3 | 4 | module.exports.run = async (client, message, args) => { 5 | if (message.author.id !== "527285622809952256") { 6 | message.channel.sendTyping().catch((err) => { 7 | console.log(err) 8 | }) 9 | 10 | await wait(Math.floor(Math.random() * 0) + 1001) 11 | 12 | return message.channel.send("no").catch((err) => { 13 | console.log(err) 14 | }) 15 | } 16 | 17 | clear() 18 | 19 | message.reply("Done").catch((err) => {}) 20 | } 21 | -------------------------------------------------------------------------------- /src/Events/Client/stickerCreate.js: -------------------------------------------------------------------------------- 1 | const { EmbedBuilder } = require("discord.js") 2 | 3 | module.exports = { 4 | name: "stickerCreate", 5 | async run(client, sticker, defaultColor, logChannel) { 6 | const logs = await client.channels.cache.get(logChannel) 7 | 8 | const embed = new EmbedBuilder() 9 | .setTitle("🆕 Sticker Created") 10 | .setDescription(`Sticker Name: **${sticker.name}**`) 11 | .setColor(defaultColor) 12 | .setTimestamp() 13 | 14 | logs.send({ 15 | embeds: [embed], 16 | }).catch((err) => { 17 | console.log(err) 18 | }) 19 | }, 20 | } 21 | -------------------------------------------------------------------------------- /src/Events/Client/stickerDelete.js: -------------------------------------------------------------------------------- 1 | const { EmbedBuilder } = require("discord.js") 2 | 3 | module.exports = { 4 | name: "stickerDelete", 5 | async run(client, sticker, defaultColor, logChannel) { 6 | const logs = await client.channels.cache.get(logChannel) 7 | 8 | const embed = new EmbedBuilder() 9 | .setTitle("👋 Sticker Deleted") 10 | .setDescription(`Sticker Name: **${sticker.name}**`) 11 | .setColor(defaultColor) 12 | .setTimestamp() 13 | 14 | logs.send({ 15 | embeds: [embed], 16 | }).catch((err) => { 17 | console.log(err) 18 | }) 19 | }, 20 | } 21 | -------------------------------------------------------------------------------- /src/Events/Client/roleCreate.js: -------------------------------------------------------------------------------- 1 | const { EmbedBuilder } = require("discord.js") 2 | 3 | module.exports = { 4 | name: "roleCreate", 5 | async run(client, role, defaultColor, logChannel) { 6 | const logs = await client.channels.cache.get(logChannel) 7 | 8 | const embed = new EmbedBuilder() 9 | .setTitle("🆕 Role Created") 10 | .setDescription(`Role Name: **${role.name}**\nID: **${role.id}**`) 11 | .setColor(defaultColor) 12 | .setTimestamp() 13 | 14 | logs.send({ 15 | embeds: [embed], 16 | }).catch((err) => { 17 | console.log(err) 18 | }) 19 | }, 20 | } 21 | -------------------------------------------------------------------------------- /src/Event_handlers/handleDistubeEvents.js: -------------------------------------------------------------------------------- 1 | const fs = require("fs") 2 | 3 | module.exports = (client, defaultColor, logChannel, announcementsChannel) => { 4 | const distubeEventFiles = fs 5 | .readdirSync("./Events/Distube/") 6 | .filter((file) => file.endsWith(".js")) 7 | 8 | for (const file of distubeEventFiles) { 9 | const event = require(`../Events/Distube/${file}`) 10 | 11 | client.distube.on(event.name, (...args) => 12 | event.run( 13 | client, 14 | ...args, 15 | defaultColor, 16 | logChannel, 17 | announcementsChannel 18 | ) 19 | ) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Events/Distube/finish.js: -------------------------------------------------------------------------------- 1 | const { EmbedBuilder } = require("discord.js") 2 | 3 | module.exports = { 4 | name: "finish", 5 | async run(client, queue, defaultColor) { 6 | const songRequests = await client.channels.cache.get( 7 | "1150910175516041266" 8 | ) 9 | 10 | songRequests 11 | .send({ 12 | embeds: [ 13 | new EmbedBuilder() 14 | .setColor(defaultColor) 15 | .setDescription(`🎶 | Queue finished`), 16 | ], 17 | }) 18 | .catch((err) => { 19 | console.log(err) 20 | }) 21 | .then((message) => { 22 | setTimeout(() => message.delete().catch((err) => {}), 15000) 23 | }) 24 | }, 25 | } 26 | -------------------------------------------------------------------------------- /src/Utilities/dm.js: -------------------------------------------------------------------------------- 1 | const { ChannelType } = require("discord.js") 2 | 3 | module.exports.run = async ({ client }) => { 4 | client.on("messageCreate", async (message) => { 5 | if (message.channel.type !== ChannelType.DM) return 6 | 7 | if (message.author.id === client.user.id) return 8 | if ( 9 | message.author.id === "527285622809952256" && 10 | message.content.toLowerCase() !== "!test" 11 | ) 12 | return 13 | 14 | const me = await client.users 15 | .fetch("527285622809952256") 16 | .catch(console.error) 17 | 18 | me.send( 19 | `**${message.author.username}** DM'd me **${message.content}**` 20 | ).catch((err) => { 21 | console.log(err) 22 | }) 23 | }) 24 | } 25 | -------------------------------------------------------------------------------- /src/Commands/Text/For_mez/bad.js: -------------------------------------------------------------------------------- 1 | const wait = require("node:timers/promises").setTimeout 2 | 3 | module.exports.run = async (client, message, args) => { 4 | if (message.author.id !== "527285622809952256") { 5 | message.channel.sendTyping().catch((err) => { 6 | console.log(err) 7 | }) 8 | 9 | await wait(Math.floor(Math.random() * 0) + 1001) 10 | 11 | return message.channel.send("no").catch((err) => { 12 | console.log(err) 13 | }) 14 | } 15 | 16 | message.channel.sendTyping().catch((err) => { 17 | console.log(err) 18 | }) 19 | 20 | await wait(Math.floor(Math.random() * 0) + 1001) 21 | 22 | message.channel.send("sowwy").catch((err) => { 23 | console.log(err) 24 | }) 25 | } 26 | -------------------------------------------------------------------------------- /src/Commands/Text/For_mez/crashboomer.js: -------------------------------------------------------------------------------- 1 | module.exports.run = async (client, message, args) => { 2 | if (message.author.id !== "527285622809952256") { 3 | return message 4 | .reply( 5 | "Only mezmer420 can use that command! (these messages will autodelete)" 6 | ) 7 | .catch((err) => {}) 8 | .then((msg) => { 9 | setTimeout(() => message.delete().catch((err) => {}), 6000) 10 | setTimeout(() => msg.delete().catch((err) => {}), 6000) 11 | }) 12 | } 13 | 14 | const spam = await client.channels.cache.get("945527434655187006") 15 | 16 | spam.send("!stopspamwakemezmer") 17 | .catch((err) => {}) 18 | .then((msg) => { 19 | msg.delete().catch((err) => {}) 20 | }) 21 | } 22 | -------------------------------------------------------------------------------- /src/Events/Distube/searchNoResult.js: -------------------------------------------------------------------------------- 1 | const { EmbedBuilder } = require("discord.js") 2 | 3 | module.exports = { 4 | name: "searchNoResult", 5 | async run(client, message, query, defaultColor) { 6 | const songRequests = await client.channels.cache.get( 7 | "1150910175516041266" 8 | ) 9 | 10 | songRequests 11 | .send({ 12 | embeds: [ 13 | new EmbedBuilder() 14 | .setColor(defaultColor) 15 | .setDescription( 16 | ` ❌ | No result found for \`${query}\`!` 17 | ), 18 | ], 19 | }) 20 | .catch((err) => { 21 | console.log(err) 22 | }) 23 | .then((message) => { 24 | setTimeout(() => message.delete().catch((err) => {}), 15000) 25 | }) 26 | }, 27 | } 28 | -------------------------------------------------------------------------------- /src/Events/Distube/error.js: -------------------------------------------------------------------------------- 1 | const { EmbedBuilder } = require("discord.js") 2 | 3 | module.exports = { 4 | name: "error", 5 | async run(client, channel, error, defaultColor) { 6 | const songRequests = await client.channels.cache.get( 7 | "1150910175516041266" 8 | ) 9 | 10 | console.log(new Date().toLocaleString() + "\n" + error) 11 | 12 | songRequests 13 | .send({ 14 | embeds: [ 15 | new EmbedBuilder() 16 | .setColor(defaultColor) 17 | .setDescription("❌ | An error occured"), 18 | ], 19 | }) 20 | .catch((err) => { 21 | console.log(err) 22 | }) 23 | .then((message) => { 24 | setTimeout(() => message.delete().catch((err) => {}), 15000) 25 | }) 26 | }, 27 | } 28 | -------------------------------------------------------------------------------- /src/Events/Distube/playSong.js: -------------------------------------------------------------------------------- 1 | const { EmbedBuilder } = require("discord.js") 2 | 3 | module.exports = { 4 | name: "playSong", 5 | async run(client, queue, song, defaultColor) { 6 | const songRequests = await client.channels.cache.get( 7 | "1150910175516041266" 8 | ) 9 | 10 | songRequests 11 | .send({ 12 | embeds: [ 13 | new EmbedBuilder() 14 | .setColor(defaultColor) 15 | .setDescription( 16 | `🎶 | Now playing \`${song.name}\` — \`${song.formattedDuration}\`` 17 | ), 18 | ], 19 | }) 20 | .catch((err) => { 21 | console.log(err) 22 | }) 23 | .then((message) => { 24 | setTimeout(() => message.delete().catch((err) => {}), 15000) 25 | }) 26 | }, 27 | } 28 | -------------------------------------------------------------------------------- /src/Commands/Interaction/Fun/flag.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder } = require("discord.js") 2 | 3 | module.exports.category = "Fun" 4 | 5 | module.exports.data = new SlashCommandBuilder() 6 | .setName("flag") 7 | .setDescription("Convert image to a flag") 8 | .addAttachmentOption((option) => 9 | option 10 | .setName("image") 11 | .setDescription("The image you want to be converted to a flag") 12 | .setRequired(true) 13 | ) 14 | 15 | module.exports.run = async ({ client, interaction }) => { 16 | const image = interaction.options.getAttachment("image") 17 | 18 | await interaction 19 | .editReply({ 20 | content: `https://krikienoid.github.io/flagwaver/#?src=${image.url}`, 21 | }) 22 | .catch((err) => {}) 23 | } 24 | -------------------------------------------------------------------------------- /src/Events/Distube/addList.js: -------------------------------------------------------------------------------- 1 | const { EmbedBuilder } = require("discord.js") 2 | 3 | module.exports = { 4 | name: "addList", 5 | async run(client, queue, playlist, defaultColor) { 6 | const songRequests = await client.channels.cache.get( 7 | "1150910175516041266" 8 | ) 9 | 10 | songRequests 11 | .send({ 12 | embeds: [ 13 | new EmbedBuilder() 14 | .setColor(defaultColor) 15 | .setDescription( 16 | `🎶 | Added \`${playlist.name}\` playlist (${playlist.songs.length} songs)` 17 | ), 18 | ], 19 | }) 20 | .catch((err) => { 21 | console.log(err) 22 | }) 23 | .then((message) => { 24 | setTimeout(() => message.delete().catch((err) => {}), 15000) 25 | }) 26 | }, 27 | } 28 | -------------------------------------------------------------------------------- /src/Events/Client/roleUpdate.js: -------------------------------------------------------------------------------- 1 | const { EmbedBuilder } = require("discord.js") 2 | 3 | module.exports = { 4 | name: "roleUpdate", 5 | async run(client, oldRole, newRole, defaultColor, logChannel) { 6 | const logs = await client.channels.cache.get(logChannel) 7 | 8 | if (oldRole.name !== newRole.name) { 9 | const embed = new EmbedBuilder() 10 | .setTitle("🌼 Role Update") 11 | .addFields({ 12 | name: "Role Name Changed", 13 | value: `**${oldRole.name}** -> **${newRole.name}**`, 14 | }) 15 | .setColor(defaultColor) 16 | .setTimestamp() 17 | 18 | return logs 19 | .send({ 20 | embeds: [embed], 21 | }) 22 | .catch((err) => { 23 | console.log(err) 24 | }) 25 | } 26 | }, 27 | } 28 | -------------------------------------------------------------------------------- /src/Events/Distube/addSong.js: -------------------------------------------------------------------------------- 1 | const { EmbedBuilder } = require("discord.js") 2 | 3 | module.exports = { 4 | name: "addSong", 5 | async run(client, queue, song, defaultColor) { 6 | const songRequests = await client.channels.cache.get( 7 | "1150910175516041266" 8 | ) 9 | 10 | songRequests 11 | .send({ 12 | embeds: [ 13 | new EmbedBuilder() 14 | .setColor(defaultColor) 15 | .setDescription( 16 | `🎶 | Added ${song.name} — \`${song.formattedDuration}\` to the queue by ${song.user}` 17 | ), 18 | ], 19 | }) 20 | .catch((err) => { 21 | console.log(err) 22 | }) 23 | .then((message) => { 24 | setTimeout(() => message.delete().catch((err) => {}), 15000) 25 | }) 26 | }, 27 | } 28 | -------------------------------------------------------------------------------- /src/Events/Client/guildBanAdd.js: -------------------------------------------------------------------------------- 1 | const { EmbedBuilder } = require("discord.js") 2 | 3 | module.exports = { 4 | name: "guildBanAdd", 5 | async run(client, ban, defaultColor, logChannel) { 6 | const logs = await client.channels.cache.get(logChannel) 7 | 8 | const embed = new EmbedBuilder() 9 | .setTitle(`🔨 Member Banned — ${ban.user.tag}`) 10 | .setDescription(`<@${ban.user.id}> was banned from the server`) 11 | .setColor("Red") 12 | .setThumbnail( 13 | `${ban.user.displayAvatarURL({ size: 4096, dynamic: true })}` 14 | ) 15 | .setFooter({ text: `Member ID: ${ban.user.id}` }) 16 | .setTimestamp() 17 | 18 | logs.send({ 19 | embeds: [embed], 20 | }).catch((err) => { 21 | console.log(err) 22 | }) 23 | }, 24 | } 25 | -------------------------------------------------------------------------------- /src/Utilities/channel-messages-delete.js: -------------------------------------------------------------------------------- 1 | const { ChannelType, MessageType } = require("discord.js") 2 | 3 | module.exports.run = async ({ client }) => { 4 | client.on("messageCreate", async (message) => { 5 | if (message.channel.type === ChannelType.DM) return 6 | if ( 7 | message.channel.id !== "990813253707911268" && // dashi changelog 8 | message.channel.id !== "1150910175516041266" // #song-requests 9 | ) 10 | return 11 | if (message.author.id === client.user.id) return 12 | 13 | const current = new Date() 14 | console.log(current.toLocaleString()) 15 | 16 | console.log( 17 | `#${message.channel.name}, ${message.author.username}: ${message.content}` 18 | ) 19 | 20 | message.delete().catch((err) => {}) 21 | }) 22 | } 23 | -------------------------------------------------------------------------------- /src/Events/Client/emojiDelete.js: -------------------------------------------------------------------------------- 1 | const { EmbedBuilder } = require("discord.js") 2 | 3 | module.exports = { 4 | name: "emojiDelete", 5 | async run(client, emoji, defaultColor, logChannel) { 6 | const logs = await client.channels.cache.get(logChannel) 7 | const auditLog = await emoji.guild.fetchAuditLogs() 8 | const logEntry = auditLog.entries.first() 9 | const { executor } = logEntry 10 | 11 | const embed = new EmbedBuilder() 12 | .setTitle("👋 Emoji Deleted") 13 | .setDescription( 14 | `Emoji Name: **${emoji.name}**\nDeleted by: <@${executor.id}>` 15 | ) 16 | .setColor(defaultColor) 17 | .setTimestamp() 18 | 19 | logs.send({ 20 | embeds: [embed], 21 | }).catch((err) => { 22 | console.log(err) 23 | }) 24 | }, 25 | } 26 | -------------------------------------------------------------------------------- /src/Events/Client/guildBanRemove.js: -------------------------------------------------------------------------------- 1 | const { EmbedBuilder } = require("discord.js") 2 | 3 | module.exports = { 4 | name: "guildBanRemove", 5 | async run(client, ban, defaultColor, logChannel) { 6 | const logs = await client.channels.cache.get(logChannel) 7 | 8 | const embed = new EmbedBuilder() 9 | .setTitle(`🦋 Member Unbanned — ${ban.user.tag}`) 10 | .setDescription(`<@${ban.user.id}> was unbanned from the server`) 11 | .setColor("Green") 12 | .setThumbnail( 13 | `${ban.user.displayAvatarURL({ size: 4096, dynamic: true })}` 14 | ) 15 | .setFooter({ text: `Member ID: ${ban.user.id}` }) 16 | .setTimestamp() 17 | 18 | logs.send({ 19 | embeds: [embed], 20 | }).catch((err) => { 21 | console.log(err) 22 | }) 23 | }, 24 | } 25 | -------------------------------------------------------------------------------- /src/Events/Client/channelDelete.js: -------------------------------------------------------------------------------- 1 | const { EmbedBuilder } = require("discord.js") 2 | 3 | module.exports = { 4 | name: "channelDelete", 5 | async run(client, channel, defaultColor, logChannel) { 6 | const logs = await client.channels.cache.get(logChannel) 7 | const auditLog = await channel.guild.fetchAuditLogs() 8 | const logEntry = auditLog.entries.first() 9 | const { executor } = logEntry 10 | 11 | const embed = new EmbedBuilder() 12 | .setTitle("👋 Channel Deleted") 13 | .setDescription( 14 | `Name: **#${channel.name}**\nDeleted by: <@${executor.id}>` 15 | ) 16 | .setColor(defaultColor) 17 | .setTimestamp() 18 | 19 | logs.send({ 20 | embeds: [embed], 21 | }).catch((err) => { 22 | console.log(err) 23 | }) 24 | }, 25 | } 26 | -------------------------------------------------------------------------------- /src/Commands/Interaction/Fun/catsay.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder } = require("discord.js") 2 | 3 | module.exports.category = "Fun" 4 | 5 | module.exports.data = new SlashCommandBuilder() 6 | .setName("catsay") 7 | .setDescription("Make The Cat say thing of your choice") 8 | .addStringOption((option) => 9 | option 10 | .setName("text") 11 | .setDescription("The text to say") 12 | .setRequired(true) 13 | ) 14 | 15 | module.exports.run = async ({ client, interaction }) => { 16 | const text = interaction.options.getString("text") 17 | 18 | await interaction 19 | .editReply({ 20 | files: [ 21 | { 22 | attachment: `https://cataas.com/cat/cute/says/${text}`, 23 | name: "catsay.png", 24 | }, 25 | ], 26 | }) 27 | .catch((err) => {}) 28 | } 29 | -------------------------------------------------------------------------------- /src/Events/Client/emojiCreate.js: -------------------------------------------------------------------------------- 1 | const { EmbedBuilder } = require("discord.js") 2 | 3 | module.exports = { 4 | name: "emojiCreate", 5 | async run(client, emoji, defaultColor, logChannel) { 6 | const logs = await client.channels.cache.get(logChannel) 7 | const auditLog = await emoji.guild.fetchAuditLogs() 8 | const logEntry = auditLog.entries.first() 9 | const { executor } = logEntry 10 | 11 | const embed = new EmbedBuilder() 12 | .setTitle("🆕 Emoji Created") 13 | .setDescription( 14 | `Emoji: <:${emoji.name}:${emoji.id}>\nID: **${emoji.id}**\nCreated by: <@${executor.id}>` 15 | ) 16 | .setColor(defaultColor) 17 | .setTimestamp() 18 | 19 | logs.send({ 20 | embeds: [embed], 21 | }).catch((err) => { 22 | console.log(err) 23 | }) 24 | }, 25 | } 26 | -------------------------------------------------------------------------------- /src/Events/Client/guildMemberRemove.js: -------------------------------------------------------------------------------- 1 | const { EmbedBuilder } = require("discord.js") 2 | 3 | module.exports = { 4 | name: "guildMemberRemove", 5 | async run(client, member, defaultColor, logChannel) { 6 | const logs = await client.channels.cache.get(logChannel) 7 | 8 | const embed = new EmbedBuilder() 9 | .setTitle(`👋 Member Left — ${member.user.tag}`) 10 | .setDescription( 11 | `<@${member.user.id}> left or was kicked/banned from the server` 12 | ) 13 | .setColor("Red") 14 | .setThumbnail( 15 | `${member.displayAvatarURL({ size: 4096, dynamic: true })}` 16 | ) 17 | .setFooter({ text: `Member ID: ${member.id}` }) 18 | .setTimestamp() 19 | 20 | logs.send({ 21 | embeds: [embed], 22 | }).catch((err) => { 23 | console.log(err) 24 | }) 25 | }, 26 | } 27 | -------------------------------------------------------------------------------- /src/Utilities/counting.js: -------------------------------------------------------------------------------- 1 | const { ChannelType, MessageType } = require("discord.js") 2 | 3 | module.exports.run = async ({ client, Counting }) => { 4 | client.on("messageCreate", async (message) => { 5 | if (message.channel.type === ChannelType.DM) return 6 | if (message.channel.id !== "1003814223845015702") return 7 | if (message.author.id === client.user.id) return 8 | 9 | let getCount = await Counting.findOne() 10 | 11 | if (!getCount) { 12 | getCount = await Counting.create({ number: 1 }) 13 | } 14 | 15 | const number = getCount.number 16 | 17 | if (message.content !== `${number}`) { 18 | return message.delete().catch((err) => {}) 19 | } 20 | 21 | await Counting.update( 22 | { number: number + 1 }, 23 | { where: { number: number } } 24 | ) 25 | }) 26 | } 27 | -------------------------------------------------------------------------------- /src/Event_handlers/handleClientEvents.js: -------------------------------------------------------------------------------- 1 | const fs = require("fs") 2 | 3 | module.exports = (client, defaultColor, logChannel, announcementsChannel) => { 4 | const clientEventFiles = fs 5 | .readdirSync("./Events/Client/") 6 | .filter((file) => file.endsWith(".js")) 7 | 8 | for (const file of clientEventFiles) { 9 | const event = require(`../Events/Client/${file}`) 10 | 11 | if (event.once) { 12 | client.once(event.name, (...args) => 13 | event.run( 14 | ...args, 15 | defaultColor, 16 | logChannel, 17 | announcementsChannel 18 | ) 19 | ) 20 | } else { 21 | client.on(event.name, (...args) => 22 | event.run( 23 | client, 24 | ...args, 25 | defaultColor, 26 | logChannel, 27 | announcementsChannel 28 | ) 29 | ) 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/Events/Client/voiceStateUpdate.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: "voiceStateUpdate", 3 | async run(client, oldState, newState, defaultColor) { 4 | if (oldState.channelId && !newState.channelId) { 5 | // Bot was disconnected? 6 | if (newState.id !== client.user.id) return 7 | 8 | const queue = await client.distube.getQueue(newState.guild.id) 9 | 10 | if (!queue) return 11 | 12 | try { 13 | await queue.stop() 14 | } catch { 15 | return 16 | } 17 | 18 | const songRequests = await client.channels.cache.get( 19 | "1150910175516041266" 20 | ) 21 | 22 | songRequests 23 | .send("I was manually disconnected; the queue has been cleared") 24 | .catch((err) => {}) 25 | .then((msg) => { 26 | setTimeout(() => msg.delete().catch((err) => {}), 10000) 27 | }) 28 | } 29 | }, 30 | } 31 | -------------------------------------------------------------------------------- /src/Commands/Interaction/Context/Avatar.js: -------------------------------------------------------------------------------- 1 | const { 2 | ContextMenuCommandBuilder, 3 | ApplicationCommandType, 4 | EmbedBuilder, 5 | } = require("discord.js") 6 | 7 | module.exports.category = "Context" 8 | 9 | module.exports.data = new ContextMenuCommandBuilder() 10 | .setName("Avatar") 11 | .setType(ApplicationCommandType.User) 12 | 13 | module.exports.run = async ({ client, interaction }) => { 14 | const { guild, targetId } = interaction 15 | 16 | const target = await guild.members.cache.get(targetId) 17 | 18 | const avatar = target.user.displayAvatarURL({ size: 4096, dynamic: true }) 19 | 20 | const embed = new EmbedBuilder() 21 | .setTitle(`${target.displayName}'s Avatar`) 22 | .setColor("Random") 23 | .setImage(avatar) 24 | 25 | await interaction 26 | .editReply({ 27 | embeds: [embed], 28 | }) 29 | .catch((err) => {}) 30 | } 31 | -------------------------------------------------------------------------------- /src/blacklisted-channels-and-categories.js: -------------------------------------------------------------------------------- 1 | const blacklistedChannels = [ 2 | "990813253707911268", // dashi changelog 3 | // "995386274091380826", // #talk-to-dashi 4 | "948675276466958336", // #media 5 | // "950419717779238993", // #videos 6 | // "1003814223845015702", // #counting 7 | // "965445390465892432", // #talking-in-gif-only 8 | // "949118223805210674", // #roleplay 9 | "1150910175516041266", // #song-requests 10 | ] 11 | 12 | const blacklistedCategories = [ 13 | "945454728400232548", // Important 14 | "965278366628446369", // Government 15 | "991803066686898246", // Tickets 16 | "964730854922403843", // Talking to Self 17 | "977400619973369896", // Uncharted Territory 18 | "961417053284221028", // The Archives 19 | ] 20 | 21 | module.exports.blacklistedChannels = blacklistedChannels 22 | 23 | module.exports.blacklistedCategories = blacklistedCategories 24 | -------------------------------------------------------------------------------- /src/Events/Client/guildScheduledEventDelete.js: -------------------------------------------------------------------------------- 1 | const { EmbedBuilder } = require("discord.js") 2 | 3 | module.exports = { 4 | name: "guildScheduledEventDelete", 5 | async run( 6 | client, 7 | guildScheduledEvent, 8 | defaultColor, 9 | logChannel, 10 | announcementsChannel 11 | ) { 12 | const logs = await client.channels.cache.get(logChannel) 13 | const anno = await client.channels.cache.get(announcementsChannel) 14 | 15 | const embed = new EmbedBuilder() 16 | .setTitle("❌ Event Cancelled") 17 | .setDescription(`Event Name: **${guildScheduledEvent.name}**`) 18 | .setColor(defaultColor) 19 | .setTimestamp() 20 | 21 | logs.send({ 22 | embeds: [embed], 23 | }).catch((err) => { 24 | console.log(err) 25 | }) 26 | 27 | // anno.send({ 28 | // embeds: [embed], 29 | // }).catch((err) => { 30 | // console.log(err) 31 | // }) 32 | }, 33 | } 34 | -------------------------------------------------------------------------------- /src/Commands/Text/For_mez/move.js: -------------------------------------------------------------------------------- 1 | const wait = require("node:timers/promises").setTimeout 2 | 3 | module.exports.run = async (client, message, args) => { 4 | if (message.author.id !== "527285622809952256") { 5 | message.channel.sendTyping().catch((err) => { 6 | console.log(err) 7 | }) 8 | 9 | await wait(Math.floor(Math.random() * 0) + 1001) 10 | 11 | return message.channel.send("no").catch((err) => { 12 | console.log(err) 13 | }) 14 | } 15 | 16 | try { 17 | const roles = await message.guild.roles.fetch() 18 | const roleToMove = roles.get("1118081712447037463") 19 | 20 | if (!roleToMove) { 21 | return message.reply("Role not found.") 22 | } 23 | 24 | // console.log(roleToMove) 25 | 26 | await roleToMove.setPosition(15) 27 | 28 | message.reply("Done.") 29 | } catch (error) { 30 | console.error(error) 31 | message.reply("An error occurred while moving the role.") 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/Commands/Interaction/Fun/pp.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, EmbedBuilder } = require("discord.js") 2 | 3 | module.exports.category = "Fun" 4 | 5 | module.exports.data = new SlashCommandBuilder() 6 | .setName("pp") 7 | .setDescription("PP size") 8 | .addUserOption((option) => 9 | option 10 | .setName("user") 11 | .setDescription("User to PP rate") 12 | .setRequired(true) 13 | ) 14 | 15 | module.exports.run = async ({ client, interaction, defaultColor }) => { 16 | const member = interaction.options.getMember("user") 17 | 18 | let size = Math.floor(Math.random() * 21) 19 | 20 | if (member.id === "826841451945787412") { 21 | // choc 22 | size = Math.floor(size * 0.3) 23 | } 24 | 25 | let PP = "8" 26 | 27 | for (let i = 0; i < size; i++) { 28 | PP += "=" 29 | } 30 | 31 | PP += "D" 32 | 33 | const embed = new EmbedBuilder() 34 | .setColor(defaultColor) 35 | .setTitle(`${member.displayName}'s PP`) 36 | .setDescription(PP) 37 | 38 | await interaction 39 | .editReply({ 40 | embeds: [embed], 41 | }) 42 | .catch((err) => {}) 43 | } 44 | -------------------------------------------------------------------------------- /src/Commands/Interaction/Utilities/diceroll.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, EmbedBuilder } = require("discord.js") 2 | 3 | module.exports.category = "Utilities" 4 | 5 | module.exports.data = new SlashCommandBuilder() 6 | .setName("diceroll") 7 | .setDescription("Roll a dice") 8 | .addIntegerOption((option) => 9 | option 10 | .setName("dice") 11 | .setDescription("The number of dice to roll; skip to roll one") 12 | .setMinValue(1) 13 | .setMaxValue(8) 14 | .setRequired(false) 15 | ) 16 | 17 | module.exports.run = async ({ client, interaction, defaultColor }) => { 18 | const dice = interaction.options.getInteger("dice") || 1 19 | 20 | const rolls = [] 21 | for (let i = 0; i < dice; i++) { 22 | rolls.push(Math.floor(Math.random() * 5) + 1) 23 | } 24 | 25 | const rollText = rolls 26 | .map((roll, index) => `Die ${index + 1} landed on **${roll}**`) 27 | .join("\n") 28 | 29 | const embed = new EmbedBuilder() 30 | .setColor(defaultColor) 31 | .setTitle("🎲 Dice roll") 32 | .setDescription(rollText) 33 | 34 | return await interaction.editReply({ embeds: [embed] }).catch((err) => {}) 35 | } 36 | -------------------------------------------------------------------------------- /src/Commands/Text/For_mez/embed2.js: -------------------------------------------------------------------------------- 1 | const { EmbedBuilder } = require("discord.js") 2 | 3 | module.exports.run = async (client, message, args) => { 4 | if (message.author.id !== "527285622809952256") { 5 | return message 6 | .reply( 7 | "Only mezmer420 can use that command! (these messages will autodelete)" 8 | ) 9 | .catch((err) => {}) 10 | .then((msg) => { 11 | setTimeout(() => message.delete().catch((err) => {}), 6000) 12 | setTimeout(() => msg.delete().catch((err) => {}), 6000) 13 | }) 14 | } 15 | 16 | message.delete().catch((err) => {}) 17 | 18 | const hydra = await client.users.fetch("547905866255433758") 19 | 20 | const concluded = new EmbedBuilder() 21 | .setColor("Red") 22 | .setTitle("Execution Concluded") 23 | .setDescription( 24 | "User: Hydra#1214\nReason: Redundant Bot\nMethod: Electric Chair\nExecutioner: <@826841451945787412>\nTime of Death: 2354 EST" 25 | ) 26 | // .setThumbnail(`https://imgur.com/a/4E2x5KB`) 27 | .setTimestamp() 28 | 29 | message.channel 30 | .send({ 31 | embeds: [concluded], 32 | }) 33 | .catch((err) => { 34 | console.log(err) 35 | }) 36 | } 37 | -------------------------------------------------------------------------------- /src/Events/Client/guildMemberUpdate.js: -------------------------------------------------------------------------------- 1 | const { EmbedBuilder, MessageSelectMenu } = require("discord.js") 2 | 3 | module.exports = { 4 | name: "guildMemberUpdate", 5 | async run(client, oldMember, newMember, defaultColor, logChannel) { 6 | const logs = await client.channels.cache.get(logChannel) 7 | 8 | if (oldMember.nickname !== newMember.nickname) { 9 | const oldNickname = oldMember.nickname ?? oldMember.user.username 10 | const newNickname = newMember.nickname ?? newMember.user.username 11 | 12 | const embed = new EmbedBuilder() 13 | .setTitle(`${newMember.user.tag}`) 14 | .setDescription(`<@${newMember.user.id}>`) 15 | .addFields({ 16 | name: "📝 Member Nickname Changed", 17 | value: `**${oldNickname}** -> **${newNickname}**`, 18 | }) 19 | .setColor(defaultColor) 20 | .setTimestamp() 21 | .setThumbnail( 22 | `${newMember.displayAvatarURL({ 23 | size: 4096, 24 | dynamic: true, 25 | })}` 26 | ) 27 | 28 | return logs 29 | .send({ 30 | embeds: [embed], 31 | }) 32 | .catch((err) => { 33 | console.log(err) 34 | }) 35 | } 36 | }, 37 | } 38 | -------------------------------------------------------------------------------- /src/Utilities/crazy-suppress.js: -------------------------------------------------------------------------------- 1 | const { ChannelType } = require("discord.js") 2 | 3 | // const { 4 | // blacklistedChannels, 5 | // blacklistedCategories, 6 | // } = require("../blacklisted-channels-and-categories") 7 | 8 | module.exports.run = async ({ client, Systems, Suppress }) => { 9 | client.on("messageCreate", async (message) => { 10 | const getCrazySuppress = await Systems.findOne({ 11 | where: { system: "Crazy Suppress" }, 12 | }) 13 | 14 | if (getCrazySuppress.online === false) return 15 | 16 | if (message.channel.type === ChannelType.DM) return 17 | // if ( 18 | // blacklistedChannels.includes(message.channel.id) || 19 | // blacklistedCategories.includes(message.channel.parent.id) 20 | // ) 21 | // return 22 | 23 | const data = await Suppress.findAll() 24 | 25 | let crazyUsers = [] 26 | 27 | for (let obj of data) { 28 | crazyUsers.push(obj.memberid) 29 | } 30 | 31 | if (!crazyUsers.includes(message.author.id)) return 32 | 33 | console.log( 34 | `#${message.channel.name}, ${message.author.username}: ${message.content}` 35 | ) 36 | 37 | message.delete().catch((err) => {}) 38 | }) 39 | } 40 | -------------------------------------------------------------------------------- /src/Events/Client/guildMemberAdd.js: -------------------------------------------------------------------------------- 1 | const { EmbedBuilder } = require("discord.js") 2 | 3 | module.exports = { 4 | name: "guildMemberAdd", 5 | async run(client, member, defaultColor, logChannel) { 6 | const logs = await client.channels.cache.get(logChannel) 7 | 8 | const createdTime = new Date( 9 | member.user.createdTimestamp + 5 * 3600000 10 | ).toLocaleString() 11 | 12 | const embed = new EmbedBuilder() 13 | .setTitle(`🛬 Member Joined — ${member.user.tag}`) 14 | .setDescription(`<@${member.user.id}> joined the server`) 15 | .addFields({ 16 | name: "Account Created at", 17 | value: `${createdTime}`, 18 | }) 19 | .setColor("Green") 20 | .setThumbnail( 21 | `${member.displayAvatarURL({ size: 4096, dynamic: true })}` 22 | ) 23 | .setFooter({ text: `Member ID: ${member.id}` }) 24 | .setTimestamp() 25 | 26 | logs.send({ 27 | embeds: [embed], 28 | }).catch((err) => { 29 | console.log(err) 30 | }) 31 | 32 | if (member.user.bot) return 33 | 34 | member 35 | .send(`${member.user.username}, welcome to Eoic Gamer Server!`) 36 | .catch((err) => { 37 | console.log(err) 38 | }) 39 | }, 40 | } 41 | -------------------------------------------------------------------------------- /src/client.distube.js: -------------------------------------------------------------------------------- 1 | const { DisTube } = require("distube") 2 | const { SpotifyPlugin } = require("@distube/spotify") 3 | const { SoundCloudPlugin } = require("@distube/soundcloud") 4 | const { YtDlpPlugin } = require("@distube/yt-dlp") 5 | const youtubeCookie = JSON.parse(process.env.youtubeCookie) 6 | 7 | module.exports = (client) => { 8 | client.distube = new DisTube(client, { 9 | plugins: [ 10 | new SpotifyPlugin({ 11 | emitEventsAfterFetching: true, 12 | }), 13 | new SoundCloudPlugin(), 14 | new YtDlpPlugin(), 15 | ], 16 | emitNewSongOnly: true, 17 | leaveOnEmpty: false, 18 | leaveOnStop: false, 19 | youtubeCookie: youtubeCookie, 20 | customFilters: { 21 | "8d": "apulsator=hz=0.09", 22 | cursed: "vibrato=f=6.5,tremolo,aresample=48000,asetrate=48000*1.25", 23 | earrape: "channelsplit,sidechaingate=level_in=64", 24 | normalizer: "dynaudnorm=f=200", 25 | purebass: "bass=g=20,dynaudnorm=f=200,asubboost,apulsator=hz=0.08", 26 | treble: "treble=g=5", 27 | vibrato: "vibrato=f=6.5", 28 | }, 29 | ytdlOptions: { 30 | quality: "highestaudio", 31 | highWaterMark: 1 << 25, 32 | }, 33 | nsfw: true, 34 | }) 35 | } 36 | -------------------------------------------------------------------------------- /src/Commands/Interaction/Fun/imagetotext.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder } = require("discord.js") 2 | const { createWorker } = require("tesseract.js") 3 | 4 | module.exports.category = "Fun" 5 | 6 | module.exports.data = new SlashCommandBuilder() 7 | .setName("imagetotext") 8 | .setDescription("Convert image to text (A.I.!)") 9 | .addAttachmentOption((option) => 10 | option 11 | .setName("image") 12 | .setDescription("The image you want to be converted to text") 13 | .setRequired(true) 14 | ) 15 | 16 | module.exports.run = async ({ client, interaction }) => { 17 | const image = interaction.options.getAttachment("image") 18 | 19 | try { 20 | const worker = await createWorker() 21 | 22 | await worker.loadLanguage("eng") 23 | 24 | await worker.initialize("eng") 25 | 26 | const { 27 | data: { text }, 28 | } = await worker.recognize(image.url) 29 | 30 | if (!text) { 31 | return await interaction.editReply({ 32 | content: "Couldn't detect any text", 33 | }) 34 | } 35 | 36 | await interaction.editReply({ 37 | content: text, 38 | }) 39 | 40 | await worker.terminate() 41 | } catch (err) { 42 | console.log(err) 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | console.log(new Date().toLocaleString()) 2 | 3 | require("dotenv").config() 4 | 5 | const { Client, Partials, ActivityType } = require("discord.js") 6 | const client = new Client({ 7 | presence: { 8 | status: "online", 9 | afk: false, 10 | activities: [ 11 | { 12 | name: "everything you say", 13 | type: ActivityType.Listening, 14 | }, 15 | ], 16 | }, 17 | intents: 131071, 18 | partials: [ 19 | Partials.Channel, 20 | Partials.GuildMember, 21 | Partials.GuildScheduledEvent, 22 | Partials.Message, 23 | Partials.Reaction, 24 | Partials.ThreadMember, 25 | Partials.User, 26 | ], 27 | }) 28 | 29 | require("./client.distube")(client) 30 | require("./commands-register")(client, true) 31 | 32 | const { token, defaultColor, logChannel, announcementsChannel } = process.env 33 | 34 | const fs = require("fs") 35 | 36 | const eventHandlers = fs 37 | .readdirSync("./Event_handlers") 38 | .filter((file) => file.endsWith(".js")) 39 | .map((file) => require(`./Event_handlers/${file}`)) 40 | 41 | eventHandlers.forEach((handler) => 42 | handler(client, defaultColor, logChannel, announcementsChannel) 43 | ) 44 | 45 | client.login(token) 46 | -------------------------------------------------------------------------------- /src/Commands/Interaction/Utilities/number.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder } = require("discord.js") 2 | 3 | module.exports.category = "Utilities" 4 | 5 | module.exports.data = new SlashCommandBuilder() 6 | .setName("number") 7 | .setDescription("Pick a random integer between two numbers, inclusive") 8 | .addIntegerOption((option) => 9 | option 10 | .setName("number1") 11 | .setDescription("The first number") 12 | .setRequired(true) 13 | ) 14 | .addIntegerOption((option) => 15 | option 16 | .setName("number2") 17 | .setDescription("The second number") 18 | .setRequired(true) 19 | ) 20 | 21 | module.exports.run = async ({ client, interaction }) => { 22 | const num1 = interaction.options.getInteger("number1") 23 | const num2 = interaction.options.getInteger("number2") 24 | 25 | function getRandomIntInclusive(min, max) { 26 | min = Math.ceil(min) 27 | max = Math.floor(max) 28 | return Math.floor(Math.random() * (max - min + 1) + min) 29 | } 30 | 31 | const randomNum = getRandomIntInclusive(num1, num2) 32 | 33 | await interaction 34 | .editReply({ 35 | content: `From ${num1} to ${num2}, I choose... **${randomNum}**`, 36 | }) 37 | .catch((err) => {}) 38 | } 39 | -------------------------------------------------------------------------------- /src/Events/Client/guildScheduledEventCreate.js: -------------------------------------------------------------------------------- 1 | const { EmbedBuilder } = require("discord.js") 2 | 3 | module.exports = { 4 | name: "guildScheduledEventCreate", 5 | async run( 6 | client, 7 | guildScheduledEvent, 8 | defaultColor, 9 | logChannel, 10 | announcementsChannel 11 | ) { 12 | const logs = await client.channels.cache.get(logChannel) 13 | const anno = await client.channels.cache.get(announcementsChannel) 14 | 15 | const startTime = new Date( 16 | guildScheduledEvent.scheduledStartTimestamp + 3600000 17 | ).toLocaleString() 18 | const endTime = new Date( 19 | guildScheduledEvent.scheduledEndTimestamp + 3600000 20 | ).toLocaleString() 21 | 22 | const embed = new EmbedBuilder() 23 | .setTitle("🎉 New Event") 24 | .setDescription( 25 | `Event Name: **${guildScheduledEvent.name}**\nStarts At: **${startTime} EST**\nEnds At: **${endTime} EST**` 26 | ) 27 | .setColor(defaultColor) 28 | .setTimestamp() 29 | 30 | logs.send({ 31 | embeds: [embed], 32 | }).catch((err) => { 33 | console.log(err) 34 | }) 35 | 36 | // anno.send({ 37 | // embeds: [embed], 38 | // }).catch((err) => { 39 | // console.log(err) 40 | // }) 41 | }, 42 | } 43 | -------------------------------------------------------------------------------- /src/Commands/Interaction/Fun/meme.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, EmbedBuilder } = require("discord.js") 2 | const fetch = require("node-fetch") 3 | 4 | module.exports.category = "Fun" 5 | 6 | module.exports.data = new SlashCommandBuilder() 7 | .setName("meme") 8 | .setDescription("Sends a meme") 9 | 10 | module.exports.run = async ({ client, interaction, defaultColor }) => { 11 | const URL = "https://meme-api.com/gimme" 12 | 13 | try { 14 | const response = await fetch(URL) 15 | const data = await response.json() 16 | 17 | if (response.status !== 200) { 18 | return await interaction 19 | .editReply({ 20 | content: "❌ | Error: Bad response", 21 | }) 22 | .catch((err) => {}) 23 | } 24 | 25 | const embed = new EmbedBuilder() 26 | .setColor(defaultColor) 27 | .setURL(data.postLink) 28 | .setImage(data.url) 29 | 30 | let title = data.title 31 | 32 | title = title.length > 50 ? title.substring(0, 50) : title 33 | 34 | embed.setTitle(title) 35 | 36 | await interaction 37 | .editReply({ 38 | embeds: [embed], 39 | }) 40 | .catch((err) => {}) 41 | } catch (error) { 42 | console.error(error) 43 | interaction 44 | .editReply({ 45 | content: "❌ | An error occurred", 46 | }) 47 | .catch((err) => {}) 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/Events/Client/channelCreate.js: -------------------------------------------------------------------------------- 1 | const { EmbedBuilder, ChannelType } = require("discord.js") 2 | 3 | module.exports = { 4 | name: "channelCreate", 5 | async run(client, channel, defaultColor, logChannel) { 6 | const logs = await client.channels.cache.get(logChannel) 7 | const auditLog = await channel.guild.fetchAuditLogs() 8 | const logEntry = auditLog.entries.first() 9 | const { executor } = logEntry 10 | 11 | let channelType 12 | let channelNsfw = channel.nsfw 13 | 14 | switch (channel.type) { 15 | case ChannelType.GuildCategory: 16 | channelType = "GuildCategory" 17 | channelNsfw = "N/A" 18 | break 19 | case ChannelType.GuildVoice: 20 | channelType = "GuildVoice" 21 | break 22 | case ChannelType.GuildText: 23 | channelType = "GuildText" 24 | break 25 | default: 26 | channelType = "Unknown" 27 | } 28 | 29 | const embed = new EmbedBuilder() 30 | .setTitle("🆕 Channel Created") 31 | .setDescription( 32 | `Channel Name: **#${channel.name}**\nID: **${channel.id}**\nType: **${channelType}**\nNSFW: **${channelNsfw}**\nCreated by: <@${executor.id}>` 33 | ) 34 | .setColor(defaultColor) 35 | .setTimestamp() 36 | 37 | logs.send({ 38 | embeds: [embed], 39 | }).catch((err) => { 40 | console.log(err) 41 | }) 42 | }, 43 | } 44 | -------------------------------------------------------------------------------- /src/Commands/Text/For_everyone/bigcock.js: -------------------------------------------------------------------------------- 1 | module.exports.run = async (client, message, args) => { 2 | const cocks = [ 3 | "https://img.hobbyfarms.com/wp-content/uploads/2017/10/05200837/big-rooster-689001268.jpg", 4 | "https://thumbs.dreamstime.com/b/beautiful-big-white-rooster-village-190230667.jpg", 5 | "https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/f/11b2e3a2-fbf2-4a7c-8488-0dddfba67bb1/ddd7ljo-294ab3e8-7c12-453f-a9ee-9d90615cf617.jpg/v1/fill/w_1280,h_1610,q_75,strp/big_rooster_by_studencik_ddd7ljo-fullview.jpg?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1cm46YXBwOjdlMGQxODg5ODIyNjQzNzNhNWYwZDQxNWVhMGQyNmUwIiwiaXNzIjoidXJuOmFwcDo3ZTBkMTg4OTgyMjY0MzczYTVmMGQ0MTVlYTBkMjZlMCIsIm9iaiI6W1t7ImhlaWdodCI6Ijw9MTYxMCIsInBhdGgiOiJcL2ZcLzExYjJlM2EyLWZiZjItNGE3Yy04NDg4LTBkZGRmYmE2N2JiMVwvZGRkN2xqby0yOTRhYjNlOC03YzEyLTQ1M2YtYTllZS05ZDkwNjE1Y2Y2MTcuanBnIiwid2lkdGgiOiI8PTEyODAifV1dLCJhdWQiOlsidXJuOnNlcnZpY2U6aW1hZ2Uub3BlcmF0aW9ucyJdfQ.wyYdVA5_A1KcZEpW43r5aZe-2h3ZlcCtjjOFD0TN4Tc", 6 | "https://i.ytimg.com/vi/CD6WSG-CU-8/maxresdefault.jpg", 7 | "https://as1.ftcdn.net/v2/jpg/03/06/48/68/1000_F_306486875_4n6usZREUd0lzKVZinlcJBBAAicnGmHB.jpg", 8 | ] 9 | const cock = cocks[Math.floor(Math.random() * cocks.length)] 10 | 11 | message.channel.send(cock).catch((err) => { 12 | console.log(err) 13 | }) 14 | } 15 | -------------------------------------------------------------------------------- /src/Commands/Interaction/Context/Translate.js: -------------------------------------------------------------------------------- 1 | const { 2 | ContextMenuCommandBuilder, 3 | ApplicationCommandType, 4 | EmbedBuilder, 5 | } = require("discord.js") 6 | const translate = require("@iamtraction/google-translate") 7 | 8 | module.exports.category = "Context" 9 | 10 | module.exports.data = new ContextMenuCommandBuilder() 11 | .setName("Translate") 12 | .setType(ApplicationCommandType.Message) 13 | 14 | module.exports.run = async ({ client, interaction, defaultColor }) => { 15 | const { channel, targetId } = interaction 16 | 17 | const query = await channel.messages.fetch({ message: targetId }) 18 | const raw = query.content 19 | 20 | if (!raw) { 21 | return await interaction 22 | .editReply({ 23 | content: "I can only translate messages with message content!", 24 | }) 25 | .catch((err) => {}) 26 | } 27 | 28 | const translated = await translate(query, { to: "en" }) 29 | 30 | const embed = new EmbedBuilder() 31 | .setColor(defaultColor) 32 | .setTitle("Translation") 33 | .addFields( 34 | { name: "Raw", value: "```" + raw + "```" }, 35 | { name: "Translated", value: "```" + translated.text + "```" } 36 | ) 37 | .setFooter({ text: "Powered by Google Translate" }) 38 | 39 | await interaction 40 | .editReply({ 41 | embeds: [embed], 42 | }) 43 | .catch((err) => {}) 44 | } 45 | -------------------------------------------------------------------------------- /src/Commands/Interaction/Fun/8ball.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, EmbedBuilder } = require("discord.js") 2 | 3 | module.exports.category = "Fun" 4 | 5 | module.exports.data = new SlashCommandBuilder() 6 | .setName("8ball") 7 | .setDescription("Ask the magic 8ball a question") 8 | .addStringOption((option) => 9 | option 10 | .setName("question") 11 | .setDescription("The question you want to ask the magic 8ball") 12 | .setRequired(true) 13 | ) 14 | 15 | module.exports.run = async ({ client, interaction, defaultColor }) => { 16 | const inquiry = interaction.options.getString("question") 17 | const fortunes = [ 18 | "yep!", 19 | "i guess", 20 | "probably not", 21 | "YES YES YES!!!11", 22 | "hell no", 23 | "um.. what?", 24 | "sorry, say again?", 25 | "what is that", 26 | "you know what just ask someone else", 27 | "i mean sure, if you believe", 28 | "without doubt", 29 | "without doubt no", 30 | "sorry son", 31 | "possibly", 32 | "in one universe out of 9876567... yes", 33 | ] 34 | const fortune = fortunes[Math.floor(Math.random() * fortunes.length)] 35 | 36 | const embed = new EmbedBuilder() 37 | .setColor(defaultColor) 38 | .setTitle(`${inquiry}`) 39 | .setDescription(`🎱 ${fortune}`) 40 | 41 | await interaction 42 | .editReply({ 43 | embeds: [embed], 44 | }) 45 | .catch((err) => {}) 46 | } 47 | -------------------------------------------------------------------------------- /src/Commands/Interaction/Utilities/dm.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder } = require("discord.js") 2 | 3 | module.exports.category = "Utilities" 4 | 5 | module.exports.data = new SlashCommandBuilder() 6 | .setName("dm") 7 | .setDescription("Make me DM a user") 8 | .addUserOption((option) => 9 | option 10 | .setName("user") 11 | .setDescription("The user to DM") 12 | .setRequired(true) 13 | ) 14 | .addStringOption((option) => 15 | option 16 | .setName("message") 17 | .setDescription("The message to DM") 18 | .setRequired(true) 19 | ) 20 | 21 | module.exports.run = async ({ client, interaction }) => { 22 | const user = interaction.options.getMember("user") 23 | const message = interaction.options.getString("message") 24 | 25 | if (user.id === client.user.id) { 26 | return await interaction 27 | .editReply({ 28 | content: "I can't DM myself idot", 29 | }) 30 | .catch((err) => {}) 31 | } 32 | 33 | user.send(message).catch(async (err) => { 34 | console.log(err) 35 | 36 | return await interaction 37 | .editReply({ 38 | content: `Failed to send that message, please try again`, 39 | }) 40 | .catch((err) => {}) 41 | }) 42 | 43 | await interaction 44 | .editReply({ 45 | content: `**${message}** successsfully sent to **${user}**! (this message will autodelete)`, 46 | }) 47 | .catch((err) => {}) 48 | .then((interaction) => { 49 | setTimeout(() => interaction.delete().catch((err) => {}), 6000) 50 | }) 51 | } 52 | -------------------------------------------------------------------------------- /src/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "dashi", 3 | "version": "1.0.0", 4 | "description": "20% cooler", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "mezmer420", 10 | "license": "ISC", 11 | "dependencies": { 12 | "@discordjs/opus": "^0.9.0", 13 | "@discordjs/rest": "^2.0.1", 14 | "@discordjs/voice": "^0.16.0", 15 | "@distube/soundcloud": "^1.3.3", 16 | "@distube/spotify": "^1.5.1", 17 | "@distube/yt-dlp": "^1.1.3", 18 | "@distube/ytdl-core": "^4.11.10", 19 | "@iamtraction/google-translate": "^2.0.1", 20 | "clear-screen": "^1.0.0", 21 | "dbd-dark-dashboard": "^1.6.62", 22 | "discord-api-types": "^0.37.48", 23 | "discord-chatbot": "^2.1.0", 24 | "discord-dashboard": "^2.3.62", 25 | "discord-html-transcripts": "^3.1.4", 26 | "discord.js": "^14.11.0", 27 | "discord.js-docs": "^0.3.0", 28 | "distube": "^4.0.4", 29 | "dotenv": "^16.3.1", 30 | "ffmpeg-static": "^5.2.0", 31 | "formidable": "^3.5.0", 32 | "i": "^0.3.7", 33 | "libsodium-wrappers": "^0.7.11", 34 | "moment": "^2.29.4", 35 | "ms": "^2.1.3", 36 | "node-cron": "^3.0.2", 37 | "node-fetch": "^2.6.7", 38 | "npm": "^9.8.0", 39 | "ns": "^1.0.2", 40 | "openai": "^3.3.0", 41 | "reconlx": "^2.5.6", 42 | "sequelize": "^6.32.1", 43 | "sqlite3": "^5.1.6", 44 | "superagent": "^8.0.9", 45 | "tesseract.js": "^4.1.1", 46 | "ytdl-core": "^4.11.4" 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # dashi 2 | ## _Yet Another Discord Bot_ 3 | 4 | Multi-function Discord bot created with discord.js v14. Single guild bot. Features include unique phrase responses ("dialects"), text and interaction commands, an economy system, reaction roles, music features, and more. 5 | 6 | Created by mezmer420#7301 7 | 8 | ## Known Issues: 9 | 10 | - If you work then immediately use daily while your work minigame is still in progress, then finish the work minigame, you'll lose the coins you got from daily 11 | 12 | ## Features: 13 | 14 | - "Dialect" message responses 15 | - General message repsonses 16 | - Text-based prefix commands 17 | - Slash (/) commands 18 | - Context menu commands 19 | - Economy and inventory system 20 | - XP and Ranking system 21 | - Children system (don't ask) 22 | - Ticket system 23 | - Music system 24 | - Birthday system 25 | - Event logging 26 | - Warn and infraction system 27 | - Message filter and auto warn 28 | - Crazy user(s) suppression system 29 | - Verification and reaction roles system 30 | - Ability to DM users/recieve DMs 31 | - Welcome messaging 32 | 33 | - Event and command handlers 34 | - Error handling anti-crash system 35 | 36 | ## Dependencies: 37 | 38 | See `src/package.json` 39 | 40 | ## NOTICE: 41 | **A purpose-built bot for one guild only!** I didn't bother making it multi-guild compatible as I never intended it ever be used outside of my own server. Not recommended to copy this project for your own use; instead feel free to browse the code for inspiration and take stuff you like. 42 | -------------------------------------------------------------------------------- /src/Commands/Interaction/Utilities/color.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, EmbedBuilder } = require("discord.js") 2 | const fetch = require("node-fetch") 3 | 4 | module.exports.category = "Utilities" 5 | 6 | module.exports.data = new SlashCommandBuilder() 7 | .setName("color") 8 | .setDescription("Gives a random color") 9 | 10 | module.exports.run = async ({ client, interaction }) => { 11 | const URL = "https://www.colr.org/json/color/random" 12 | 13 | async function fetchData() { 14 | try { 15 | const response = await fetch(URL) 16 | const data = await response.json() 17 | 18 | if (response.status !== 200) { 19 | return await interaction 20 | .editReply({ 21 | content: "❌ | Error: Bad response", 22 | }) 23 | .catch((err) => {}) 24 | } 25 | 26 | if (data.colors[0].hex === "" || !data.colors[0].tags[0].name) { 27 | // Bad data received; restart the fetching procedure 28 | return fetchData() 29 | } 30 | 31 | const embed = new EmbedBuilder() 32 | .setColor(`#${data.colors[0].hex}`) 33 | .setTitle(`${data.colors[0].tags[0].name}`) 34 | .setDescription(`Hex: ${data.colors[0].hex}`) 35 | .setFooter({ text: "colr.org" }) 36 | 37 | await interaction 38 | .editReply({ 39 | embeds: [embed], 40 | }) 41 | .catch((err) => {}) 42 | } catch (error) { 43 | console.error(error) 44 | interaction 45 | .editReply({ 46 | content: "❌ | An error occurred", 47 | }) 48 | .catch((err) => {}) 49 | } 50 | } 51 | 52 | fetchData() 53 | } 54 | -------------------------------------------------------------------------------- /src/Commands/Interaction/Fun/stopspam.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder } = require("discord.js") 2 | 3 | module.exports.category = "Fun" 4 | 5 | module.exports.data = new SlashCommandBuilder() 6 | .setName("stopspam") 7 | .setDescription("Stop the existing spam") 8 | 9 | module.exports.run = async ({ client, interaction, Spam }) => { 10 | if (interaction.channel.id !== "945527434655187006") { 11 | return await interaction 12 | .editReply({ 13 | content: 14 | "You can only use that command in <#945527434655187006>! (this message will autodelete)", 15 | }) 16 | .catch((err) => {}) 17 | .then((interaction) => { 18 | setTimeout(() => interaction.delete().catch((err) => {}), 6000) 19 | }) 20 | } 21 | 22 | const getSpam = await Spam.findOne({ where: { active: true } }) 23 | 24 | if (!getSpam) { 25 | return await interaction 26 | .editReply({ 27 | content: "There's no existing spam", 28 | }) 29 | .catch((err) => {}) 30 | } 31 | 32 | const starter = await getSpam.starterid 33 | 34 | if ( 35 | interaction.member.id !== starter && 36 | interaction.member.id !== "527285622809952256" 37 | ) { 38 | return await interaction 39 | .editReply({ 40 | content: "You are not permitted to stop the current spam.", 41 | }) 42 | .catch((err) => {}) 43 | } 44 | 45 | await Spam.update({ active: false }, { where: { active: true } }) 46 | 47 | clearInterval(interval) 48 | 49 | await interaction 50 | .editReply({ 51 | content: "Spam stopped", 52 | }) 53 | .catch((err) => {}) 54 | } 55 | -------------------------------------------------------------------------------- /src/Commands/Interaction/Info/systems.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, EmbedBuilder } = require("discord.js") 2 | 3 | module.exports.category = "Info" 4 | 5 | module.exports.data = new SlashCommandBuilder() 6 | .setName("systems") 7 | .setDescription("View systems statuses") 8 | 9 | module.exports.run = async ({ client, interaction, Systems, defaultColor }) => { 10 | const getStatus = async (system) => { 11 | const data = await Systems.findOne({ where: { system } }) 12 | return data.online ? "🟢 Online" : "🔴 Offline" 13 | } 14 | 15 | const systems = [ 16 | "XP", 17 | "Dialects", 18 | "General Responses", 19 | "Economy", 20 | "Music", 21 | "Waifus", 22 | "Birthdays", 23 | "Fricking", 24 | "Message Filter & Auto Warn", 25 | "Crazy Suppress", 26 | "Anti-crash Logging", 27 | ] 28 | 29 | const fields = [] 30 | 31 | for (const system of systems) { 32 | const status = await getStatus(system) 33 | fields.push({ 34 | name: system, 35 | value: status, 36 | inline: true, 37 | }) 38 | } 39 | 40 | // console.log(fields) 41 | 42 | const dashi = client.user 43 | 44 | const embed = new EmbedBuilder() 45 | .setColor(defaultColor) 46 | .setAuthor({ 47 | name: "Systems", 48 | iconURL: dashi.displayAvatarURL({ 49 | size: 4096, 50 | dynamic: true, 51 | }), 52 | }) 53 | .addFields(...fields) 54 | .setTimestamp() 55 | // .setFooter({ 56 | // text: "*Only controls logging; anti-crash system is always on", 57 | // }) 58 | 59 | return await interaction 60 | .editReply({ 61 | embeds: [embed], 62 | }) 63 | .catch((err) => {}) 64 | } 65 | -------------------------------------------------------------------------------- /src/Commands/Interaction/Info/roleinfo.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, EmbedBuilder } = require("discord.js") 2 | 3 | module.exports.category = "Info" 4 | 5 | module.exports.data = new SlashCommandBuilder() 6 | .setName("roleinfo") 7 | .setDescription("View info about a role") 8 | .addRoleOption((option) => 9 | option 10 | .setName("role") 11 | .setDescription("The role to view info of") 12 | .setRequired(true) 13 | ) 14 | 15 | module.exports.run = async ({ client, interaction, defaultColor }) => { 16 | const role = interaction.options.getRole("role") 17 | 18 | const displayed = role.hoist === true ? "Yes" : "No" 19 | 20 | const mentionable = role.mentionable === true ? "Yes" : "No" 21 | 22 | const createdTime = new Date( 23 | role.createdTimestamp + 6 * 3600000 24 | ).toLocaleString() 25 | 26 | const embed = new EmbedBuilder() 27 | .setColor(defaultColor) 28 | .addFields( 29 | { name: "Role Name", value: `<@&${role.id}>`, inline: true }, 30 | { name: "Role ID", value: `${role.id}`, inline: true }, 31 | { 32 | name: "Users in Role", 33 | value: `${role.members.size}`, 34 | inline: true, 35 | } 36 | ) 37 | .addFields( 38 | { name: "Mentionable", value: `${mentionable}`, inline: true }, 39 | { 40 | name: "Displayed Seperately?", 41 | value: `${displayed}`, 42 | inline: true, 43 | }, 44 | { name: "Color", value: `${role.hexColor}`, inline: true } 45 | ) 46 | .setFooter({ text: `Role Creation Date | ${createdTime}` }) 47 | 48 | // console.log(role.members) 49 | 50 | await interaction 51 | .editReply({ 52 | embeds: [embed], 53 | }) 54 | .catch((err) => {}) 55 | } 56 | -------------------------------------------------------------------------------- /src/Commands/Text/For_vmezchoc/s.js: -------------------------------------------------------------------------------- 1 | module.exports.run = async (client, message, args) => { 2 | const vmezchoc = [ 3 | "527285622809952256", // mezmer 4 | "762133129209053244", // vcash 5 | "826841451945787412", // choc 6 | ] 7 | const isAllowedUser = vmezchoc.includes(message.author.id) 8 | 9 | if (!isAllowedUser) { 10 | return message 11 | .reply( 12 | "Only mezmer420, cookies, and vcash can use that command! (these messages will autodelete)" 13 | ) 14 | .catch(() => {}) 15 | .then((msg) => { 16 | setTimeout(() => message.delete().catch(() => {}), 6000) 17 | setTimeout(() => msg.delete().catch(() => {}), 6000) 18 | }) 19 | } 20 | 21 | const sayWord = "!s" 22 | const index = message.content.indexOf(sayWord) 23 | 24 | if (index !== -1) { 25 | const messagetosend = message.content.slice(index + sayWord.length + 1) 26 | 27 | if (!messagetosend) { 28 | return message 29 | .reply( 30 | "Specify what you want me to say! Command format is `!s [message]`" 31 | ) 32 | .catch(() => {}) 33 | } 34 | 35 | message.delete().catch(() => {}) 36 | 37 | return message.channel.send(`${messagetosend}`).catch((err) => { 38 | console.log(err) 39 | }) 40 | 41 | // message.channel 42 | // .send(`${messagetosend}`) 43 | // .catch((err) => { 44 | // return console.log(err) 45 | // }) 46 | // .then((sentMessage) => { 47 | // sentMessage.react("1️⃣") 48 | // sentMessage.react("2️⃣") 49 | // sentMessage.react("3️⃣") 50 | // sentMessage.react("4️⃣") 51 | // sentMessage.react("5️⃣") 52 | // sentMessage.react("6️⃣") 53 | // sentMessage.react("7️⃣") 54 | // }) 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/Commands/Interaction/Info/ping.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, EmbedBuilder } = require("discord.js") 2 | const os = require("os") 3 | 4 | module.exports.category = "Info" 5 | 6 | module.exports.data = new SlashCommandBuilder() 7 | .setName("ping") 8 | .setDescription("Pong!") 9 | 10 | module.exports.run = async ({ client, interaction, defaultColor }) => { 11 | const first = await interaction 12 | .editReply({ 13 | content: "Calculating...", 14 | }) 15 | .catch((err) => {}) 16 | 17 | const ping = first.createdTimestamp - interaction.createdTimestamp 18 | const memoryUsage = (process.memoryUsage().heapUsed / 1024 / 1024).toFixed( 19 | 2 20 | ) 21 | const totalMemory = (os.totalmem() / 1024 / 1024).toFixed(2) 22 | const days = Math.floor(client.uptime / 86400000) 23 | const hours = Math.floor(client.uptime / 3600000) % 24 24 | const minutes = Math.floor(client.uptime / 60000) % 60 25 | const seconds = Math.floor(client.uptime / 1000) % 60 26 | 27 | const embed = new EmbedBuilder() 28 | .setColor(defaultColor) 29 | .setTitle("🏓 Pong!") 30 | .addFields( 31 | { name: "Bot Latency", value: `${ping} ms`, inline: true }, 32 | { 33 | name: "API Latency", 34 | value: `${client.ws.ping} ms`, 35 | inline: true, 36 | }, 37 | { 38 | name: "Memory Usage", 39 | value: `${memoryUsage} / ${totalMemory} MB`, 40 | inline: true, 41 | }, 42 | { 43 | name: "Uptime", 44 | value: `\`${days}\` days, \`${hours}\` hours, \`${minutes}\` minutes, and \`${seconds}\` seconds`, 45 | } 46 | ) 47 | .setTimestamp() 48 | 49 | await interaction 50 | .editReply({ 51 | content: "", 52 | embeds: [embed], 53 | }) 54 | .catch((err) => {}) 55 | } 56 | -------------------------------------------------------------------------------- /src/Commands/Interaction/Waifus/waifu.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, EmbedBuilder } = require("discord.js") 2 | 3 | module.exports.category = "Waifus" 4 | 5 | module.exports.data = new SlashCommandBuilder() 6 | .setName("waifu") 7 | .setDescription( 8 | "View your or another user's waifu; leave blank to view your own" 9 | ) 10 | .addUserOption((option) => 11 | option 12 | .setName("user") 13 | .setDescription("User to view the avatar of") 14 | .setRequired(false) 15 | ) 16 | 17 | module.exports.run = async ({ client, interaction, Systems, Waifus }) => { 18 | const getWaifus = await Systems.findOne({ 19 | where: { system: "Waifus" }, 20 | }) 21 | 22 | if (getWaifus.online === false) { 23 | return await interaction 24 | .editReply({ 25 | content: "The Waifus system is currently disabled", 26 | }) 27 | .catch((err) => {}) 28 | } 29 | 30 | const member = interaction.options.getMember("user") || interaction.member 31 | 32 | const getUser = await Waifus.findOne({ where: { id: member.id } }) 33 | 34 | if (getUser) { 35 | const existingWaifu = getUser.waifu 36 | 37 | const response = 38 | member.id === interaction.member.id 39 | ? `Your waifu is **${existingWaifu}**` 40 | : `${member.displayName}'s waifu is **${existingWaifu}**` 41 | 42 | return await interaction 43 | .editReply({ 44 | content: response, 45 | }) 46 | .catch((err) => {}) 47 | } else if (!getUser) { 48 | const response = 49 | member.id === interaction.member.id 50 | ? `You don't have a waifu lol` 51 | : `${member.nickname} doesn't have a waifu lol` 52 | 53 | return await interaction 54 | .editReply({ 55 | content: response, 56 | }) 57 | .catch((err) => {}) 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/Events/Client/messageReactionRemove.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: "messageReactionRemove", 3 | async run(client, reaction, user, defaultColor) { 4 | if (reaction.partial) { 5 | try { 6 | await reaction.fetch() 7 | } catch (error) { 8 | return console.error( 9 | "Something went wrong fetching reaction: ", 10 | error 11 | ) 12 | } 13 | } 14 | 15 | if (user.bot) return 16 | 17 | const member = reaction.message.guild.members.cache.get(user.id) 18 | 19 | // if (reaction.message.id === "963931617276071946") { 20 | // let roleID 21 | 22 | // // if (reaction.emoji.name === "1️⃣") { 23 | // // roleID = "956642101653827674" 24 | // // } else if (reaction.emoji.name === "2️⃣") { 25 | // // roleID = "953099131797270588" 26 | // // } else if (reaction.emoji.name === "3️⃣") { 27 | // // roleID = "952349639426854973" 28 | // // } else if (reaction.emoji.name === "4️⃣") { 29 | // // roleID = "963928836356051025" 30 | // // } else if (reaction.emoji.name === "5️⃣") { 31 | // // roleID = "963933396227219497" 32 | // // } 33 | // if (reaction.emoji.name === "6️⃣") { 34 | // roleID = "964556786105475092" 35 | // } 36 | // // else if (reaction.emoji.name === "7️⃣") { 37 | // // roleID = "969432438516375603" 38 | // // } else if (reaction.emoji.name === "8️⃣") { 39 | // // roleID = "999905439615561828" 40 | // // } 41 | // else if (reaction.emoji.name === "9️⃣") { 42 | // roleID = "1000505530978152569" 43 | // } else return 44 | 45 | // if (!member.roles.cache.has(roleID)) return 46 | 47 | // member.roles.remove(roleID).catch((err) => { 48 | // console.log("Error removing role: ", err) 49 | // }) 50 | // } 51 | }, 52 | } 53 | -------------------------------------------------------------------------------- /src/Commands/Interaction/Economy/balance.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, EmbedBuilder } = require("discord.js") 2 | 3 | module.exports.category = "Economy" 4 | 5 | module.exports.data = new SlashCommandBuilder() 6 | .setName("balance") 7 | .setDescription("Check the balance of yourself or another user") 8 | .addUserOption((option) => 9 | option 10 | .setName("user") 11 | .setDescription( 12 | "User to check the balance of; skip to view your own balance" 13 | ) 14 | .setRequired(false) 15 | ) 16 | 17 | module.exports.run = async ({ 18 | client, 19 | interaction, 20 | Systems, 21 | Economy, 22 | defaultColor, 23 | }) => { 24 | const getEconomy = await Systems.findOne({ 25 | where: { system: "Economy" }, 26 | }) 27 | 28 | if (getEconomy.online === false) { 29 | return await interaction 30 | .editReply({ 31 | content: "The Economy system is currently disabled", 32 | }) 33 | .catch((err) => {}) 34 | } 35 | 36 | const member = interaction.options.getMember("user") || interaction.member 37 | const getUser = 38 | (await Economy.findOne({ where: { id: member.id } })) || 39 | (await Economy.create({ id: member.id, wallet: 0, bank: 0 })) 40 | 41 | const embed = new EmbedBuilder() 42 | .setTitle(`💰 ${member.displayName}'s Balance`) 43 | .setDescription( 44 | `**Wallet:** \`${getUser.wallet}\` Dashcoins:tm:\n**Bank:** \`${ 45 | getUser.bank 46 | }\` Dashcoins:tm:\n——————————\n**Net:** \`${ 47 | getUser.wallet + getUser.bank 48 | }\` Dashcoins:tm:` 49 | ) 50 | .setColor(defaultColor) 51 | .setThumbnail( 52 | member.user.displayAvatarURL({ size: 4096, dynamic: true }) 53 | ) 54 | 55 | await interaction 56 | .editReply({ 57 | embeds: [embed], 58 | }) 59 | .catch((err) => {}) 60 | } 61 | -------------------------------------------------------------------------------- /src/Utilities/dead-chat.js: -------------------------------------------------------------------------------- 1 | module.exports.run = async ({ client }) => { 2 | async function checkForActivity() { 3 | const channel = await client.channels.cache.get("939674946953682976") 4 | 5 | if (!channel) return 6 | 7 | channel.messages 8 | .fetch({ limit: 1 }) 9 | .then((messages) => { 10 | const lastMessage = messages.first() 11 | const responses = [ 12 | "https://tenor.com/view/dead-chat-dead-chat-skeleton-gif-25954239", 13 | "https://tenor.com/view/dead-chat-xd-dead-chat-gif-22992239", 14 | "https://tenor.com/view/dead-group-chat-gif-24956654", 15 | "https://tenor.com/view/googas-wet-wet-cat-dead-chat-dead-chat-xd-gif-20820186", 16 | "https://tenor.com/view/rip-chat-chat-dead-dead-chat-inactive-gif-18754855", 17 | "https://tenor.com/view/dead-chat-xd-gif-25076264", 18 | "https://tenor.com/view/minecraft-dead-chat-dead-chat-xd-gif-24629150", 19 | ] 20 | 21 | if (responses.includes(lastMessage.content)) return 22 | 23 | const timeSinceLastMessage = 24 | Date.now() - lastMessage.createdTimestamp 25 | 26 | // if the last message is older than 18 hours 27 | if (timeSinceLastMessage > 60 * 60 * 18 * 1000) { 28 | // console.log(timeSinceLastMessage) 29 | 30 | const response = 31 | responses[Math.floor(Math.random() * responses.length)] 32 | 33 | channel.send(response) 34 | } 35 | }) 36 | .catch(console.error) 37 | 38 | const intervalTime = 39 | Math.floor( 40 | Math.random() * (2 * 60 * 60 * 1000 - 1 * 60 * 60 * 1000 + 1) 41 | ) + 42 | 1 * 60 * 60 * 1000 43 | 44 | // Call the checkForActivity function again after the random interval time 45 | setTimeout(checkForActivity, intervalTime) 46 | } 47 | 48 | checkForActivity() 49 | } 50 | -------------------------------------------------------------------------------- /src/Commands/Interaction/Music/autoplay.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, EmbedBuilder } = require("discord.js") 2 | 3 | module.exports.category = "Music" 4 | 5 | module.exports.data = new SlashCommandBuilder() 6 | .setName("autoplay") 7 | .setDescription("Toggle autoplay; auto adds new songs if queue empty") 8 | 9 | module.exports.run = async ({ client, interaction, Systems, defaultColor }) => { 10 | const getMusic = await Systems.findOne({ 11 | where: { system: "Music" }, 12 | }) 13 | 14 | if (getMusic.online === false) { 15 | return await interaction 16 | .editReply({ 17 | content: "The Music system is currently disabled", 18 | }) 19 | .catch((err) => {}) 20 | } 21 | 22 | if (interaction.channel.id !== "1150910175516041266") { 23 | return await interaction 24 | .editReply({ 25 | content: 26 | "You can only use that command in <#1150910175516041266>! (this message will autodelete)", 27 | }) 28 | .catch((err) => {}) 29 | .then((interaction) => { 30 | setTimeout(() => interaction.delete().catch((err) => {}), 6000) 31 | }) 32 | } 33 | 34 | const queue = await client.distube.getQueue(interaction.guildId) 35 | 36 | if (!queue) { 37 | return await interaction 38 | .editReply({ 39 | content: "There are no songs in the queue", 40 | }) 41 | .catch((err) => {}) 42 | .then((interaction) => { 43 | setTimeout(() => interaction.delete().catch((err) => {}), 10000) 44 | }) 45 | } 46 | 47 | const autoplay = await queue.toggleAutoplay() 48 | 49 | return await interaction 50 | .editReply({ 51 | content: `🎶 | AutoPlay: \`${autoplay ? "On" : "Off"}\``, 52 | }) 53 | .catch((err) => {}) 54 | .then((interaction) => { 55 | setTimeout(() => interaction.delete().catch((err) => {}), 10000) 56 | }) 57 | } 58 | -------------------------------------------------------------------------------- /src/Commands/Interaction/Utilities/choose.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder } = require("discord.js") 2 | 3 | module.exports.category = "Utilities" 4 | 5 | module.exports.data = new SlashCommandBuilder() 6 | .setName("choose") 7 | .setDescription("I will choose something for you") 8 | .addStringOption((option) => 9 | option 10 | .setName("1st") 11 | .setDescription("The 1st thing to choose from") 12 | .setRequired(true) 13 | ) 14 | .addStringOption((option) => 15 | option 16 | .setName("2nd") 17 | .setDescription("The 2nd thing to choose from") 18 | .setRequired(true) 19 | ) 20 | 21 | function toOrdinalSuffix(num) { 22 | const int = parseInt(num), 23 | digits = [int % 10, int % 100], 24 | ordinals = ["st", "nd", "rd", "th"], 25 | oPattern = [1, 2, 3, 4], 26 | tPattern = [11, 12, 13, 14, 15, 16, 17, 18, 19] 27 | 28 | return oPattern.includes(digits[0]) && !tPattern.includes(digits[1]) 29 | ? int + ordinals[digits[0] - 1] 30 | : int + ordinals[3] 31 | } 32 | 33 | for (let i = 3; i <= 10; i++) { 34 | module.exports.data.addStringOption((option) => 35 | option 36 | .setName(`${toOrdinalSuffix(i)}`) 37 | .setDescription(`The ${toOrdinalSuffix(i)} thing to choose from`) 38 | .setRequired(false) 39 | ) 40 | } 41 | 42 | module.exports.run = async ({ client, interaction }) => { 43 | let responseValues = [] 44 | 45 | for (let i = 1; i <= 10; i++) { 46 | const option = interaction.options.getString(`${toOrdinalSuffix(i)}`) 47 | 48 | if (option) { 49 | responseValues.push(option) 50 | } 51 | } 52 | 53 | const response = 54 | responseValues[Math.floor(Math.random() * responseValues.length)] 55 | 56 | await interaction 57 | .editReply({ 58 | content: `I choose... **${response}**`, 59 | }) 60 | .catch((err) => {}) 61 | } 62 | -------------------------------------------------------------------------------- /src/Commands/Interaction/Fun/spam.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder } = require("discord.js") 2 | 3 | module.exports.category = "Fun" 4 | 5 | module.exports.data = new SlashCommandBuilder() 6 | .setName("spam") 7 | .setDescription("Spam ping a user") 8 | .addUserOption((option) => 9 | option 10 | .setName("victim") 11 | .setDescription("User to spam") 12 | .setRequired(true) 13 | ) 14 | .addStringOption((option) => 15 | option 16 | .setName("message") 17 | .setDescription("Optional message to send") 18 | .setRequired(false) 19 | ) 20 | 21 | module.exports.run = async ({ client, interaction, Spam }) => { 22 | if (interaction.channel.id !== "945527434655187006") { 23 | return await interaction 24 | .editReply({ 25 | content: 26 | "You can only use that command in <#945527434655187006>! (this message will autodelete)", 27 | }) 28 | .catch((err) => {}) 29 | .then((interaction) => { 30 | setTimeout(() => interaction.delete().catch((err) => {}), 6000) 31 | }) 32 | } 33 | 34 | const getSpam = await Spam.findOne({ where: { active: true } }) 35 | 36 | if (getSpam) { 37 | return await interaction 38 | .editReply({ 39 | content: "A spam is already active!", 40 | }) 41 | .catch((err) => {}) 42 | } 43 | 44 | const member = interaction.options.getMember("victim") 45 | const messageContent = interaction.options.getString("message") || "" 46 | 47 | await Spam.update( 48 | { starterid: interaction.member.id, active: true }, 49 | { where: { active: false } } 50 | ) 51 | 52 | await interaction 53 | .editReply({ 54 | content: "Spam started!", 55 | }) 56 | .catch((err) => {}) 57 | 58 | interval = setInterval(function () { 59 | interaction.channel 60 | .send(`<@${member.id}> ${messageContent}`) 61 | .catch((err) => {}) 62 | }, 2000) 63 | } 64 | -------------------------------------------------------------------------------- /src/Events/Client/userUpdate.js: -------------------------------------------------------------------------------- 1 | const { EmbedBuilder, MessageSelectMenu } = require("discord.js") 2 | 3 | module.exports = { 4 | name: "userUpdate", 5 | async run(client, oldUser, newUser, defaultColor, logChannel) { 6 | const logs = await client.channels.cache.get(logChannel) 7 | 8 | const embed = new EmbedBuilder() 9 | .setTitle(`${newUser.tag}`) 10 | .setDescription(`<@${newUser.id}>`) 11 | .setColor(defaultColor) 12 | .setTimestamp() 13 | 14 | if (oldUser.username !== newUser.username) { 15 | embed 16 | .addFields({ 17 | name: "📝 Member Username Changed", 18 | value: `**${oldUser.username}** -> **${newUser.username}**`, 19 | }) 20 | .setThumbnail( 21 | `${newUser.displayAvatarURL({ 22 | size: 4096, 23 | dynamic: true, 24 | })}` 25 | ) 26 | 27 | return logs 28 | .send({ 29 | embeds: [embed], 30 | }) 31 | .catch((err) => { 32 | console.log(err) 33 | }) 34 | } else if (oldUser.displayAvatarURL() !== newUser.displayAvatarURL()) { 35 | embed 36 | .addFields({ 37 | name: "✈️ Member Display Avatar Changed", 38 | value: `${oldUser.displayAvatarURL()} -> ${newUser.displayAvatarURL()}`, 39 | }) 40 | .setThumbnail(`${newUser.displayAvatarURL()}`) 41 | 42 | return logs 43 | .send({ 44 | embeds: [embed], 45 | }) 46 | .catch((err) => { 47 | console.log(err) 48 | }) 49 | } else if (oldUser.avatarURL() !== newUser.avatarURL()) { 50 | embed 51 | .addFields({ 52 | name: "✈️ Member Avatar Changed", 53 | value: `${oldUser.avatarURL()} -> ${newUser.avatarURL()}`, 54 | }) 55 | .setThumbnail(`${newUser.avatarURL()}`) 56 | 57 | return logs 58 | .send({ 59 | embeds: [embed], 60 | }) 61 | .catch((err) => { 62 | console.log(err) 63 | }) 64 | } 65 | }, 66 | } 67 | -------------------------------------------------------------------------------- /src/Commands/Interaction/Fun/urban.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, EmbedBuilder } = require("discord.js") 2 | const fetch = require("node-fetch") 3 | 4 | module.exports.category = "Fun" 5 | 6 | module.exports.data = new SlashCommandBuilder() 7 | .setName("urban") 8 | .setDescription( 9 | "Define a term from Urban Dictionary (top result displayed)" 10 | ) 11 | .addStringOption((option) => 12 | option 13 | .setName("search-query") 14 | .setDescription("The search term") 15 | .setRequired(true) 16 | ) 17 | 18 | module.exports.run = async ({ client, interaction }) => { 19 | const query = interaction.options.getString("search-query") 20 | 21 | search = encodeURIComponent(query) 22 | 23 | const { list } = await fetch( 24 | `https://api.urbandictionary.com/v0/define?term=${search}` 25 | ).then((res) => res.json()) 26 | 27 | const [answer] = list 28 | 29 | function trim(input) { 30 | return input.length > 1024 ? `${input.slice(0, 1020)} ...` : input 31 | } 32 | 33 | if (!answer) { 34 | return await interaction 35 | .editReply({ 36 | content: `❌ | No results for **${query}**`, 37 | }) 38 | .catch((err) => {}) 39 | } 40 | 41 | const example = 42 | answer.example.length > 0 ? trim(answer.example) : "(None provided)" 43 | 44 | const embed = new EmbedBuilder() 45 | .setTitle(answer.word) 46 | .setURL(answer.permalink) 47 | .setColor("Random") 48 | .setThumbnail("https://i.imgur.com/VFXr0ID.jpg") 49 | .addFields( 50 | { name: "Definition", value: trim(answer.definition) }, 51 | { name: "Example", value: example }, 52 | { 53 | name: "Ratings", 54 | value: `👍 ${answer.thumbs_up} || 👎 ${answer.thumbs_down}`, 55 | } 56 | ) 57 | 58 | .setFooter({ text: `Entry by ${answer.author}` }) 59 | 60 | await interaction 61 | .editReply({ 62 | embeds: [embed], 63 | }) 64 | .catch((err) => {}) 65 | } 66 | -------------------------------------------------------------------------------- /src/Commands/Interaction/Fun/hack.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder } = require("discord.js") 2 | const wait = require("node:timers/promises").setTimeout 3 | 4 | module.exports.category = "Fun" 5 | 6 | module.exports.data = new SlashCommandBuilder() 7 | .setName("hack") 8 | .setDescription("heck someone") 9 | .addUserOption((option) => 10 | option 11 | .setName("target") 12 | .setDescription("The user to heck") 13 | .setRequired(true) 14 | ) 15 | 16 | module.exports.run = async ({ client, interaction }) => { 17 | const victim = interaction.options.getMember("target") 18 | 19 | try { 20 | await interaction.editReply({ 21 | content: `Hacking ${victim.displayName}....`, 22 | }) 23 | 24 | await wait(1000) 25 | 26 | await interaction.editReply({ 27 | content: `Finding ${victim.displayName}'s Email and Password.....`, 28 | }) 29 | 30 | await wait(5000) 31 | 32 | await interaction.editReply({ 33 | content: `E-Mail: ${victim.displayName}@gmail.com \nPassword: ********`, 34 | }) 35 | 36 | await wait(3000) 37 | 38 | await interaction.editReply({ 39 | content: "Finding Other Accounts.....", 40 | }) 41 | 42 | await wait(6000) 43 | 44 | await interaction.editReply({ 45 | content: "Setting up Epic Games Account.....", 46 | }) 47 | 48 | await wait(6000) 49 | 50 | await interaction.editReply({ 51 | content: "Hacking Epic Games Account......", 52 | }) 53 | 54 | await wait(7000) 55 | 56 | await interaction.editReply({ 57 | content: "Hacked Epic Games Account!!", 58 | }) 59 | 60 | await wait(3000) 61 | 62 | await interaction.editReply({ 63 | content: "Collecting Info.....", 64 | }) 65 | 66 | await wait(7000) 67 | 68 | await interaction.editReply({ 69 | content: "Selling data to FBI....", 70 | }) 71 | 72 | await wait(3000) 73 | 74 | await interaction.editReply({ 75 | content: `Finished hacking ${victim.displayName}`, 76 | }) 77 | } catch (err) {} 78 | } 79 | -------------------------------------------------------------------------------- /src/text-command-handler.js: -------------------------------------------------------------------------------- 1 | const { ChannelType } = require("discord.js") 2 | 3 | const fs = require("fs") 4 | 5 | const getFiles = (dir, suffix) => { 6 | const files = fs.readdirSync(dir, { 7 | withFileTypes: true, 8 | }) 9 | 10 | let commandFiles = [] 11 | 12 | for (const file of files) { 13 | if (file.isDirectory()) { 14 | commandFiles = [ 15 | ...commandFiles, 16 | ...getFiles(`${dir}/${file.name}`, suffix), 17 | ] 18 | } else if (file.name.endsWith(suffix)) { 19 | commandFiles.push(`${dir}/${file.name}`) 20 | } 21 | } 22 | 23 | // console.log(commandFiles) 24 | 25 | return commandFiles 26 | } 27 | 28 | module.exports = (client) => { 29 | const commands = {} 30 | 31 | const commandFiles = getFiles("./Commands/Text", ".js") 32 | // console.log(commandFiles) 33 | 34 | for (const command of commandFiles) { 35 | // console.log(command) 36 | 37 | let commandFile = require(command) 38 | if (commandFile.default) { 39 | commandFile = commandFile.default 40 | } 41 | 42 | const split = command.replace(/\\/g, "/").split("/") 43 | const commandName = split[split.length - 1].replace(".js", "") 44 | 45 | commands[commandName.toLowerCase()] = commandFile 46 | } 47 | 48 | // console.log(commands) 49 | console.log("Successfully loaded text (!) commands") 50 | 51 | client.on("messageCreate", (message) => { 52 | if (!message.content.startsWith("!") || message.author.bot) return 53 | 54 | const args = message.content.slice(1).split(/ +/) 55 | const commandName = args.shift().toLowerCase() 56 | 57 | if (!commands[commandName]) return 58 | 59 | if ( 60 | !commands[commandName].dm && 61 | message.channel.type !== ChannelType.GuildText 62 | ) 63 | return 64 | 65 | if (commands[commandName].dm && message.channel.type !== ChannelType.DM) 66 | return 67 | 68 | try { 69 | commands[commandName].run(client, message, ...args) 70 | } catch (error) { 71 | console.error(error) 72 | } 73 | }) 74 | } 75 | -------------------------------------------------------------------------------- /src/Commands/Interaction/Music/pause.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder } = require("discord.js") 2 | 3 | module.exports.category = "Music" 4 | 5 | module.exports.data = new SlashCommandBuilder() 6 | .setName("pause") 7 | .setDescription("Pauses the music") 8 | 9 | module.exports.run = async ({ client, interaction, Systems, defaultColor }) => { 10 | const getMusic = await Systems.findOne({ 11 | where: { system: "Music" }, 12 | }) 13 | 14 | if (getMusic.online === false) { 15 | return await interaction 16 | .editReply({ 17 | content: "The Music system is currently disabled", 18 | }) 19 | .catch((err) => {}) 20 | } 21 | 22 | if (interaction.channel.id !== "1150910175516041266") { 23 | return await interaction 24 | .editReply({ 25 | content: 26 | "You can only use that command in <#1150910175516041266>! (this message will autodelete)", 27 | }) 28 | .catch((err) => {}) 29 | .then((interaction) => { 30 | setTimeout(() => interaction.delete().catch((err) => {}), 6000) 31 | }) 32 | } 33 | 34 | const queue = await client.distube.getQueue(interaction.guildId) 35 | 36 | if (!queue) { 37 | return await interaction 38 | .editReply({ content: "There are no songs in the queue" }) 39 | .catch((err) => {}) 40 | .then((interaction) => { 41 | setTimeout(() => interaction.delete().catch((err) => {}), 10000) 42 | }) 43 | } 44 | 45 | if (queue.paused) { 46 | return await interaction 47 | .editReply({ 48 | content: "The music is already paused", 49 | }) 50 | .catch((err) => {}) 51 | .then((interaction) => { 52 | setTimeout(() => interaction.delete().catch((err) => {}), 10000) 53 | }) 54 | } 55 | 56 | await queue.pause() 57 | 58 | await interaction 59 | .editReply({ 60 | content: 61 | "The music has been paused! Use `/resume` to resume the music", 62 | }) 63 | .catch((err) => {}) 64 | .then((interaction) => { 65 | setTimeout(() => interaction.delete().catch((err) => {}), 10000) 66 | }) 67 | } 68 | -------------------------------------------------------------------------------- /src/Commands/Interaction/Music/resume.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder } = require("discord.js") 2 | 3 | module.exports.category = "Music" 4 | 5 | module.exports.data = new SlashCommandBuilder() 6 | .setName("resume") 7 | .setDescription("Resumes the music") 8 | 9 | module.exports.run = async ({ client, interaction, Systems, defaultColor }) => { 10 | const getMusic = await Systems.findOne({ 11 | where: { system: "Music" }, 12 | }) 13 | 14 | if (getMusic.online === false) { 15 | return await interaction 16 | .editReply({ 17 | content: "The Music system is currently disabled", 18 | }) 19 | .catch((err) => {}) 20 | } 21 | 22 | if (interaction.channel.id !== "1150910175516041266") { 23 | return await interaction 24 | .editReply({ 25 | content: 26 | "You can only use that command in <#1150910175516041266>! (this message will autodelete)", 27 | }) 28 | .catch((err) => {}) 29 | .then((interaction) => { 30 | setTimeout(() => interaction.delete().catch((err) => {}), 6000) 31 | }) 32 | } 33 | 34 | const queue = await client.distube.getQueue(interaction.guildId) 35 | 36 | if (!queue) { 37 | return await interaction 38 | .editReply({ content: "There are no songs in the queue" }) 39 | .catch((err) => {}) 40 | .then((interaction) => { 41 | setTimeout(() => interaction.delete().catch((err) => {}), 10000) 42 | }) 43 | } 44 | 45 | if (!queue.paused) { 46 | return await interaction 47 | .editReply({ 48 | content: "The music is already playing", 49 | }) 50 | .catch((err) => {}) 51 | .then((interaction) => { 52 | setTimeout(() => interaction.delete().catch((err) => {}), 10000) 53 | }) 54 | } 55 | 56 | await queue.resume() 57 | 58 | await interaction 59 | .editReply({ 60 | content: 61 | "The music has been resumed! Use `/pause` to pause the music again", 62 | }) 63 | .catch((err) => {}) 64 | .then((interaction) => { 65 | setTimeout(() => interaction.delete().catch((err) => {}), 10000) 66 | }) 67 | } 68 | -------------------------------------------------------------------------------- /src/Commands/Interaction/Government/voting.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, PermissionFlagsBits } = require("discord.js") 2 | 3 | module.exports.category = "Government" 4 | 5 | module.exports.data = new SlashCommandBuilder() 6 | .setName("voting") 7 | .setDescription("Start a server vote") 8 | .addStringOption((option) => 9 | option 10 | .setName("message") 11 | .setDescription("The message to send") 12 | .setRequired(true) 13 | ) 14 | .addChannelOption((option) => 15 | option 16 | .setName("channel") 17 | .setDescription("The channel to send to") 18 | .setRequired(false) 19 | ) 20 | .setDefaultMemberPermissions(PermissionFlagsBits.KickMembers) 21 | 22 | for (i = 1; i <= 5; i++) { 23 | module.exports.data.addStringOption((option) => 24 | option 25 | .setName(`emoji${i}`) 26 | .setDescription(`Reaction emoji ${i}`) 27 | .setRequired(false) 28 | ) 29 | } 30 | 31 | module.exports.run = async ({ client, interaction }) => { 32 | const whatever = interaction.options.getString("message") 33 | 34 | const voting = 35 | interaction.options.getChannel("channel") || 36 | (await client.channels.cache.get("939674946953682976")) // general 37 | 38 | const emoji1 = interaction.options.getString("emoji1") || "👍" 39 | const emoji2 = interaction.options.getString("emoji2") || "👎" 40 | const emoji3 = interaction.options.getString("emoji3") 41 | const emoji4 = interaction.options.getString("emoji4") 42 | const emoji5 = interaction.options.getString("emoji5") 43 | 44 | voting 45 | .send(whatever) 46 | .catch((err) => {}) 47 | .then(async (msg) => { 48 | await msg.react(emoji1).catch((err) => {}) 49 | await msg.react(emoji2).catch((err) => {}) 50 | 51 | if (emoji3) { 52 | await msg.react(emoji3).catch((err) => {}) 53 | } 54 | if (emoji4) { 55 | await msg.react(emoji4).catch((err) => {}) 56 | } 57 | if (emoji5) { 58 | await msg.react(emoji5).catch((err) => {}) 59 | } 60 | }) 61 | 62 | interaction.deleteReply().catch((err) => {}) 63 | } 64 | -------------------------------------------------------------------------------- /src/Commands/Interaction/Economy/daily.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder } = require("discord.js") 2 | const ms = require("ms") 3 | 4 | module.exports.category = "Economy" 5 | 6 | module.exports.data = new SlashCommandBuilder() 7 | .setName("daily") 8 | .setDescription("Get 200 Dashcoins for free every 16 hours") 9 | 10 | module.exports.run = async ({ 11 | client, 12 | interaction, 13 | Systems, 14 | Economy, 15 | dailyCooldown, 16 | }) => { 17 | const getEconomy = await Systems.findOne({ 18 | where: { system: "Economy" }, 19 | }) 20 | 21 | if (getEconomy.online === false) { 22 | return await interaction 23 | .editReply({ 24 | content: "The Economy system is currently disabled", 25 | }) 26 | .catch((err) => {}) 27 | } 28 | 29 | const getDailyCooldown = await dailyCooldown.findOne({ 30 | where: { id: interaction.member.id }, 31 | }) 32 | 33 | const dailyCooldownTime = getDailyCooldown?.expiry 34 | 35 | if (getDailyCooldown && dailyCooldownTime > new Date().getTime()) { 36 | return await interaction 37 | .editReply({ 38 | content: `Wait **${ms( 39 | dailyCooldownTime - new Date().getTime(), 40 | { long: true } 41 | )}** before acquiring your next daily!`, 42 | }) 43 | .catch((err) => {}) 44 | } 45 | 46 | if (getDailyCooldown) { 47 | dailyCooldown.destroy({ where: { id: interaction.member.id } }) 48 | } 49 | 50 | const getUser = 51 | (await Economy.findOne({ 52 | where: { id: interaction.member.id }, 53 | })) || 54 | (await Economy.create({ 55 | id: interaction.member.id, 56 | wallet: 0, 57 | bank: 0, 58 | })) 59 | 60 | const coinsEarned = 200 61 | 62 | await Economy.update( 63 | { wallet: getUser.wallet + coinsEarned }, 64 | { where: { id: interaction.member.id } } 65 | ) 66 | 67 | await dailyCooldown.create({ 68 | id: interaction.member.id, 69 | expiry: new Date().getTime() + 57600000, 70 | }) 71 | 72 | await interaction 73 | .editReply({ 74 | content: `You got **200** Dashcoins:tm:!`, 75 | }) 76 | .catch((err) => {}) 77 | } 78 | -------------------------------------------------------------------------------- /src/Commands/Interaction/Music/shuffle.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder } = require("discord.js") 2 | 3 | module.exports.category = "Music" 4 | 5 | module.exports.data = new SlashCommandBuilder() 6 | .setName("shuffle") 7 | .setDescription("Shuffles the queue") 8 | 9 | module.exports.run = async ({ client, interaction, Systems, defaultColor }) => { 10 | const getMusic = await Systems.findOne({ 11 | where: { system: "Music" }, 12 | }) 13 | 14 | if (getMusic.online === false) { 15 | return await interaction 16 | .editReply({ 17 | content: "The Music system is currently disabled", 18 | }) 19 | .catch((err) => {}) 20 | } 21 | 22 | if (interaction.channel.id !== "1150910175516041266") { 23 | return await interaction 24 | .editReply({ 25 | content: 26 | "You can only use that command in <#1150910175516041266>! (this message will autodelete)", 27 | }) 28 | .catch((err) => {}) 29 | .then((interaction) => { 30 | setTimeout(() => interaction.delete().catch((err) => {}), 6000) 31 | }) 32 | } 33 | 34 | const queue = await client.distube.getQueue(interaction.guildId) 35 | 36 | if (!queue) { 37 | return await interaction 38 | .editReply({ 39 | content: "There are no songs in the queue", 40 | }) 41 | .catch((err) => {}) 42 | .then((interaction) => { 43 | setTimeout(() => interaction.delete().catch((err) => {}), 10000) 44 | }) 45 | } 46 | 47 | if (queue.songs.length === 1) { 48 | return await interaction 49 | .editReply({ 50 | content: "There are no songs in the queue to shuffle", 51 | }) 52 | .catch((err) => {}) 53 | .then((interaction) => { 54 | setTimeout(() => interaction.delete().catch((err) => {}), 15000) 55 | }) 56 | } 57 | 58 | await queue.shuffle() 59 | 60 | await interaction 61 | .editReply({ 62 | content: `The queue of ${ 63 | queue.songs.length - 1 64 | } songs has been shuffled!`, 65 | }) 66 | .catch((err) => {}) 67 | .then((interaction) => { 68 | setTimeout(() => interaction.delete().catch((err) => {}), 15000) 69 | }) 70 | } 71 | -------------------------------------------------------------------------------- /src/Commands/Interaction/Utilities/timer.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, EmbedBuilder } = require("discord.js") 2 | 3 | module.exports.category = "Utilities" 4 | 5 | module.exports.data = new SlashCommandBuilder() 6 | .setName("timer") 7 | .setDescription("Set a timer") 8 | .addIntegerOption((option) => 9 | option 10 | .setName("seconds") 11 | .setDescription("The time in seconds") 12 | .setMinValue(1) 13 | .setMaxValue(86400) 14 | .setRequired(true) 15 | ) 16 | .addStringOption((option) => 17 | option 18 | .setName("reminder") 19 | .setDescription("What to remind you about") 20 | .setRequired(true) 21 | ) 22 | 23 | module.exports.run = async ({ client, interaction, defaultColor }) => { 24 | const time = interaction.options.getInteger("seconds") 25 | const subject = interaction.options.getString("reminder") 26 | const milliseconds = time * 1000 27 | 28 | const createdEmbed = new EmbedBuilder() 29 | .setColor(defaultColor) 30 | .setTitle("Timer Set") 31 | .setAuthor({ 32 | name: `${interaction.member.user.tag}'s Timer ⏱️`, 33 | iconURL: interaction.member.displayAvatarURL({ 34 | size: 4096, 35 | dynamic: true, 36 | }), 37 | }) 38 | .setDescription( 39 | `In **${time} seconds**, I will remind you about **${subject}**` 40 | ) 41 | .setTimestamp() 42 | 43 | const doneEmbed = new EmbedBuilder() 44 | .setColor(defaultColor) 45 | .setTitle("Timer Up!") 46 | .setAuthor({ 47 | name: `${interaction.member.user.tag}'s Timer ⏱️`, 48 | iconURL: interaction.member.displayAvatarURL({ 49 | size: 4096, 50 | dynamic: true, 51 | }), 52 | }) 53 | .setDescription(`**${subject}**\nTime set: **${time} seconds**`) 54 | .setTimestamp() 55 | 56 | await interaction.editReply({ 57 | embeds: [createdEmbed], 58 | }) 59 | 60 | setTimeout(async () => { 61 | await interaction 62 | .editReply({ 63 | embeds: [doneEmbed], 64 | }) 65 | .catch((err) => { 66 | return 67 | }) 68 | interaction.member.send( 69 | `<@${interaction.member.id}> The timer you set **${time} seconds** ago is up! Reminder: **${subject}**` 70 | ) 71 | }, milliseconds) 72 | } 73 | -------------------------------------------------------------------------------- /src/Commands/Interaction/Economy/withdraw.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, EmbedBuilder } = require("discord.js") 2 | 3 | module.exports.category = "Economy" 4 | 5 | module.exports.data = new SlashCommandBuilder() 6 | .setName("withdraw") 7 | .setDescription("Withdraw Dashcoins from bank") 8 | .addIntegerOption((option) => 9 | option 10 | .setName("amount") 11 | .setDescription("The amount to withdraw") 12 | .setMinValue(1) 13 | .setMaxValue(5000) 14 | .setRequired(true) 15 | ) 16 | 17 | module.exports.run = async ({ client, interaction, Systems, Economy }) => { 18 | const getEconomy = await Systems.findOne({ 19 | where: { system: "Economy" }, 20 | }) 21 | 22 | if (getEconomy.online === false) { 23 | return await interaction 24 | .editReply({ 25 | content: "The Economy system is currently disabled", 26 | }) 27 | .catch((err) => {}) 28 | } 29 | 30 | const amount = interaction.options.getInteger("amount") 31 | 32 | const getUser = 33 | (await Economy.findOne({ 34 | where: { id: interaction.member.id }, 35 | })) || 36 | (await Economy.create({ 37 | id: interaction.member.id, 38 | wallet: 0, 39 | bank: 0, 40 | })) 41 | 42 | if (getUser.bank < amount) { 43 | return await interaction 44 | .editReply({ 45 | content: "Insufficient bank balance", 46 | }) 47 | .catch((err) => {}) 48 | } 49 | 50 | const newSenderWallet = getUser.wallet + amount 51 | const newSenderBank = getUser.bank - amount 52 | 53 | await Economy.update( 54 | { wallet: newSenderWallet, bank: newSenderBank }, 55 | { where: { id: interaction.member.id } } 56 | ) 57 | 58 | const dashcoinOrDashcoins = amount === 1 ? "Dashcoin" : "Dashcoins" 59 | 60 | const embed = new EmbedBuilder() 61 | .setTitle("💸 Coin withdrawal complete 💸") 62 | .setDescription( 63 | `**${amount}** ${dashcoinOrDashcoins}:tm: withdrawn from your bank!` 64 | ) 65 | .setColor("Green") 66 | // .setThumbnail( 67 | // interaction.member.user.displayAvatarURL({ 68 | // size: 4096, 69 | // dynamic: true, 70 | // }) 71 | // ) 72 | 73 | await interaction 74 | .editReply({ 75 | embeds: [embed], 76 | }) 77 | .catch((err) => {}) 78 | } 79 | -------------------------------------------------------------------------------- /src/Commands/Text/For_mez/ticket.js: -------------------------------------------------------------------------------- 1 | const { EmbedBuilder, ActionRowBuilder, ButtonBuilder } = require("discord.js") 2 | 3 | const openTicketId = "982689993195667527" 4 | 5 | module.exports.run = async (client, message, args) => { 6 | if (message.author.id !== "527285622809952256") { 7 | return message 8 | .reply( 9 | "Only mezmer420 can use that command! (these messages will autodelete)" 10 | ) 11 | .catch((err) => {}) 12 | .then((msg) => { 13 | setTimeout(() => message.delete().catch((err) => {}), 6000) 14 | setTimeout(() => msg.delete().catch((err) => {}), 6000) 15 | }) 16 | } 17 | 18 | const { guild } = interaction 19 | 20 | const embed = new EmbedBuilder() 21 | .setColor(defaultColor) 22 | .setAuthor({ 23 | name: "Tickets 🎫", 24 | iconURL: guild.iconURL({ size: 4096, dynamic: true }), 25 | }) 26 | .setDescription( 27 | "Click a button below to open a ticket and personally discuss an issue with the Government" 28 | ) 29 | .addFields( 30 | { 31 | name: "User Report", 32 | value: "For ~~snitching~~ informing us of someone who violated the law as outlined in the Constitution", 33 | inline: true, 34 | }, 35 | { 36 | name: "Bug Report", 37 | value: "For informing us a bug you are aware of with one of our bots", 38 | inline: true, 39 | }, 40 | { 41 | name: "Other Report", 42 | value: "Select this option if the issue is something else", 43 | inline: true, 44 | } 45 | ) 46 | 47 | const buttons = new ActionRowBuilder().addComponents( 48 | new ButtonBuilder() 49 | .setCustomId("reportuser") 50 | .setLabel("User Report") 51 | .setStyle("Primary") 52 | .setEmoji("👮"), 53 | 54 | new ButtonBuilder() 55 | .setCustomId("reportbug") 56 | .setLabel("Bug Report") 57 | .setStyle("Success") 58 | .setEmoji("🐛"), 59 | 60 | new ButtonBuilder() 61 | .setCustomId("reportother") 62 | .setLabel("Other Report") 63 | .setStyle("Secondary") 64 | .setEmoji("❓") 65 | ) 66 | 67 | await guild.channels.cache 68 | .get(openTicketId) 69 | .send({ 70 | embeds: [embed], 71 | components: [buttons], 72 | }) 73 | .catch((err) => { 74 | console.log(err) 75 | }) 76 | } 77 | -------------------------------------------------------------------------------- /src/Commands/Interaction/Economy/deposit.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, EmbedBuilder } = require("discord.js") 2 | 3 | module.exports.category = "Economy" 4 | 5 | module.exports.data = new SlashCommandBuilder() 6 | .setName("deposit") 7 | .setDescription("Deposit Dashcoins into bank; leave blank to deposit max") 8 | .addIntegerOption((option) => 9 | option 10 | .setName("amount") 11 | .setDescription("The amount to deposit") 12 | .setRequired(false) 13 | ) 14 | 15 | module.exports.run = async ({ client, interaction, Systems, Economy }) => { 16 | const getEconomy = await Systems.findOne({ 17 | where: { system: "Economy" }, 18 | }) 19 | 20 | if (getEconomy.online === false) { 21 | return await interaction 22 | .editReply({ 23 | content: "The Economy system is currently disabled", 24 | }) 25 | .catch((err) => {}) 26 | } 27 | 28 | const getUser = 29 | (await Economy.findOne({ 30 | where: { id: interaction.member.id }, 31 | })) || 32 | (await Economy.create({ 33 | id: interaction.member.id, 34 | wallet: 0, 35 | bank: 0, 36 | })) 37 | 38 | const amount = interaction.options.getInteger("amount") || getUser.wallet 39 | 40 | if (getUser.wallet < amount) { 41 | return await interaction 42 | .editReply({ 43 | content: "Insufficient wallet balance!", 44 | }) 45 | .catch((err) => {}) 46 | } 47 | 48 | if (getUser.wallet === 0) { 49 | return await interaction 50 | .editReply({ 51 | content: "Your wallet is empty, nothing to deposit", 52 | }) 53 | .catch((err) => {}) 54 | } 55 | 56 | const newSenderWallet = getUser.wallet - amount 57 | const newSenderBank = getUser.bank + amount 58 | 59 | await Economy.update( 60 | { wallet: newSenderWallet, bank: newSenderBank }, 61 | { where: { id: interaction.member.id } } 62 | ) 63 | 64 | const embed = new EmbedBuilder() 65 | .setTitle("💸 Coin deposit complete 💸") 66 | .setDescription(`**${amount}** Dashcoins:tm: deposited in your bank!`) 67 | .setColor("Green") 68 | // .setThumbnail( 69 | // interaction.member.user.displayAvatarURL({ 70 | // size: 4096, 71 | // dynamic: true, 72 | // }) 73 | // ) 74 | 75 | await interaction 76 | .editReply({ 77 | embeds: [embed], 78 | }) 79 | .catch((err) => {}) 80 | } 81 | -------------------------------------------------------------------------------- /src/Commands/Interaction/Admins/say.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, PermissionFlagsBits } = require("discord.js") 2 | const wait = require("node:timers/promises").setTimeout 3 | 4 | module.exports.category = "Admins" 5 | 6 | module.exports.data = new SlashCommandBuilder() 7 | .setName("say") 8 | .setDescription("Make me say whatever you want anywhere >;)") 9 | .addStringOption((option) => 10 | option 11 | .setName("message") 12 | .setDescription("The message I say") 13 | .setRequired(true) 14 | ) 15 | .addChannelOption((option) => 16 | option 17 | .setName("channel") 18 | .setDescription("The channel to say in") 19 | .setRequired(false) 20 | ) 21 | .addIntegerOption((option) => 22 | option 23 | .setName("typing") 24 | .setDescription("Time spent typing; default none") 25 | .setMinValue(1) 26 | .setMaxValue(30) 27 | .setRequired(false) 28 | ) 29 | .addStringOption((option) => 30 | option 31 | .setName("pin") 32 | .setDescription("Pin the message or not; default no") 33 | .setRequired(false) 34 | .addChoices({ name: "Yes", value: "Yes" }) 35 | ) 36 | .setDefaultMemberPermissions(PermissionFlagsBits.Administrator) 37 | 38 | module.exports.run = async ({ client, interaction }) => { 39 | await interaction.deleteReply().catch((err) => {}) 40 | 41 | const whatever = interaction.options.getString("message") 42 | const destination = 43 | interaction.options.getChannel("channel") || interaction.channel 44 | const typing = interaction.options.getInteger("typing") 45 | const pin = interaction.options.getString("pin") || "No" 46 | 47 | if (typing) { 48 | let remainingTypingDuration = typing 49 | 50 | while (remainingTypingDuration > 0) { 51 | const currentTypingDuration = Math.min(remainingTypingDuration, 10) 52 | 53 | await interaction.channel.sendTyping().catch((err) => { 54 | console.log(err) 55 | }) 56 | await wait(currentTypingDuration * 1000) 57 | 58 | remainingTypingDuration -= currentTypingDuration 59 | } 60 | } 61 | 62 | destination 63 | .send(whatever) 64 | .catch((err) => { 65 | console.log(err) 66 | }) 67 | .then((message) => { 68 | if (pin === "Yes") { 69 | message.pin().catch((err) => { 70 | console.log(err) 71 | }) 72 | } 73 | }) 74 | } 75 | -------------------------------------------------------------------------------- /src/commands-register.js: -------------------------------------------------------------------------------- 1 | const { Collection } = require("discord.js") 2 | const { REST } = require("@discordjs/rest") 3 | const { Routes } = require("discord-api-types/v10") 4 | const { token } = process.env 5 | const fs = require("fs") 6 | const path = require("path") 7 | 8 | module.exports = async (client, updateCommands) => { 9 | let commands = [] 10 | 11 | client.commands = new Collection() 12 | 13 | handleCommands = (commandFolders, foldersPath) => { 14 | for (const folder of commandFolders) { 15 | const commandsPath = path.join(foldersPath, folder) 16 | const commandFiles = fs 17 | .readdirSync(commandsPath) 18 | .filter((file) => file.endsWith(".js")) 19 | 20 | for (const file of commandFiles) { 21 | const commandPath = path.join(commandsPath, file) 22 | const command = require(commandPath) 23 | 24 | if (command.category && command.data && command.run) { 25 | // console.log(command) 26 | 27 | client.commands.set(command.data.name, command) 28 | commands.push(command.data.toJSON()) 29 | } else { 30 | console.log( 31 | `[WARNING] The command at ${commandPath} is missing required category/data/run property(ies); command not loaded.` 32 | ) 33 | } 34 | } 35 | } 36 | } 37 | 38 | const foldersPath = path.join(__dirname, "./Commands/Interaction") 39 | const commandFolders = fs.readdirSync(foldersPath) 40 | 41 | await handleCommands(commandFolders, foldersPath) 42 | 43 | // console.log(client.commands) 44 | // console.log(commands) 45 | 46 | if (updateCommands === true) { 47 | ;(async () => { 48 | try { 49 | console.log("Started refreshing application commands") 50 | 51 | const rest = new REST({ version: "10" }).setToken(token) 52 | const clientId = "956345939130482750" 53 | const guildId = "939674946379083847" 54 | 55 | await rest.put(Routes.applicationCommands(clientId), { 56 | body: commands, 57 | }) 58 | 59 | // await rest.put( 60 | // Routes.applicationGuildCommands(clientId, guildId), 61 | // { body: commands } 62 | // ) 63 | 64 | console.log( 65 | `Successfully reloaded ${commands.length} application commands` 66 | ) 67 | } catch (error) { 68 | console.error(error) 69 | } 70 | })() 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /src/Commands/Interaction/Info/docs.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, EmbedBuilder } = require("discord.js") 2 | const Docs = require("discord.js-docs") 3 | 4 | module.exports.category = "Info" 5 | 6 | module.exports.data = new SlashCommandBuilder() 7 | .setName("docs") 8 | .setDescription("Search the official Discord.JS documentation") 9 | .addStringOption((option) => 10 | option 11 | .setName("search-query") 12 | .setDescription("Search the official Discord.JS documentation") 13 | .setRequired(true) 14 | ) 15 | 16 | module.exports.run = async ({ client, interaction, defaultColor }) => { 17 | const query = interaction.options.getString("search-query") 18 | const branch = "stable" 19 | 20 | const max = 1024 21 | 22 | const replaceDisco = (str) => 23 | str 24 | .replace(/docs\/docs\/disco/g, `docs/discord.js/${branch}`) 25 | .replace(/ \(disco\)/g, "") 26 | 27 | const doc = await Docs.fetch(branch) 28 | const results = await doc.resolveEmbed(query) 29 | 30 | if (!results) { 31 | return await interaction 32 | .editReply({ 33 | content: `❌ | No results for **${query}**`, 34 | }) 35 | .catch((err) => {}) 36 | } 37 | 38 | const string = replaceDisco(JSON.stringify(results)) 39 | 40 | const embed = JSON.parse(string) 41 | 42 | embed.color = parseInt(defaultColor.slice(1), 16) 43 | embed.author.url = `https://discord.js/#/docs/discord.js/${branch}/general/welcome` 44 | 45 | const extra = 46 | "\n\nView more here: " + 47 | /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/ 48 | .exec(embed.description)[0] 49 | .split(")")[0] 50 | 51 | for (const field of embed.fields || []) { 52 | if (field.value.length >= max) { 53 | field.value = field.value.slice(0, max) 54 | const split = field.value.split(" ") 55 | let joined = split.join(" ") 56 | 57 | while (joined.length >= max - extra.length) { 58 | split.pop() 59 | joined = split.join(" ") 60 | } 61 | 62 | field.value = joined + extra 63 | } 64 | } 65 | 66 | if ( 67 | embed.fields && 68 | embed.fields[embed.fields.length - 1].value.startsWith("[View source]") 69 | ) { 70 | embed.fields.pop() 71 | } 72 | 73 | await interaction 74 | .editReply({ 75 | embeds: [embed], 76 | }) 77 | .catch((err) => {}) 78 | } 79 | -------------------------------------------------------------------------------- /src/Commands/Interaction/Music/skipto.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder } = require("discord.js") 2 | 3 | module.exports.category = "Music" 4 | 5 | module.exports.data = new SlashCommandBuilder() 6 | .setName("skipto") 7 | .setDescription("Skips to a song # in the queue") 8 | .addIntegerOption((option) => 9 | option 10 | .setName("songnumber") 11 | .setDescription("The song to skip to") 12 | .setMinValue(1) 13 | .setRequired(true) 14 | ) 15 | 16 | module.exports.run = async ({ client, interaction, Systems, defaultColor }) => { 17 | const getMusic = await Systems.findOne({ 18 | where: { system: "Music" }, 19 | }) 20 | 21 | if (getMusic.online === false) { 22 | return await interaction 23 | .editReply({ 24 | content: "The Music system is currently disabled", 25 | }) 26 | .catch((err) => {}) 27 | } 28 | 29 | if (interaction.channel.id !== "1150910175516041266") { 30 | return await interaction 31 | .editReply({ 32 | content: 33 | "You can only use that command in <#1150910175516041266>! (this message will autodelete)", 34 | }) 35 | .catch((err) => {}) 36 | .then((interaction) => { 37 | setTimeout(() => interaction.delete().catch((err) => {}), 6000) 38 | }) 39 | } 40 | 41 | const queue = await client.distube.getQueue(interaction.guildId) 42 | 43 | if (!queue) { 44 | return await interaction 45 | .editReply({ 46 | content: "There are no songs in the queue", 47 | }) 48 | .catch((err) => {}) 49 | .then((interaction) => { 50 | setTimeout(() => interaction.delete().catch((err) => {}), 10000) 51 | }) 52 | } 53 | 54 | const trackNum = interaction.options.getInteger("songnumber") 55 | 56 | if (trackNum > queue.songs.length) { 57 | return await interaction 58 | .editReply({ 59 | content: `Invalid track number. There exists only ${queue.songs.length} songs in the queue`, 60 | }) 61 | .catch((err) => {}) 62 | .then((interaction) => { 63 | setTimeout(() => interaction.delete().catch((err) => {}), 10000) 64 | }) 65 | } 66 | 67 | await queue.jump(trackNum) 68 | 69 | await interaction 70 | .editReply({ 71 | content: `Skipped ahead to song number ${trackNum}`, 72 | }) 73 | .catch((err) => {}) 74 | .then((interaction) => { 75 | setTimeout(() => interaction.delete().catch((err) => {}), 15000) 76 | }) 77 | } 78 | -------------------------------------------------------------------------------- /src/Commands/Interaction/Music/seek.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, EmbedBuilder } = require("discord.js") 2 | 3 | module.exports.category = "Music" 4 | 5 | module.exports.data = new SlashCommandBuilder() 6 | .setName("seek") 7 | .setDescription("Seek to a position in the current song") 8 | .addIntegerOption((option) => 9 | option 10 | .setName("seconds") 11 | .setDescription("Position in seconds to seek to") 12 | .setMinValue(0) 13 | .setRequired(true) 14 | ) 15 | 16 | module.exports.run = async ({ client, interaction, Systems, defaultColor }) => { 17 | const getMusic = await Systems.findOne({ 18 | where: { system: "Music" }, 19 | }) 20 | 21 | if (getMusic.online === false) { 22 | return await interaction 23 | .editReply({ 24 | content: "The Music system is currently disabled", 25 | }) 26 | .catch((err) => {}) 27 | } 28 | 29 | if (interaction.channel.id !== "1150910175516041266") { 30 | return await interaction 31 | .editReply({ 32 | content: 33 | "You can only use that command in <#1150910175516041266>! (this message will autodelete)", 34 | }) 35 | .catch((err) => {}) 36 | .then((interaction) => { 37 | setTimeout(() => interaction.delete().catch((err) => {}), 6000) 38 | }) 39 | } 40 | 41 | const queue = client.distube.getQueue(interaction.guildId) 42 | 43 | if (!queue) { 44 | return await interaction 45 | .editReply({ content: "There is nothing playing" }) 46 | .catch((err) => {}) 47 | .then((interaction) => { 48 | setTimeout(() => interaction.delete().catch((err) => {}), 10000) 49 | }) 50 | } 51 | 52 | const seconds = interaction.options.getInteger("seconds") 53 | 54 | const currentSong = queue.songs[0] 55 | 56 | if (seconds > currentSong.duration) { 57 | return await interaction 58 | .editReply({ 59 | content: `Invalid input. The current song is **${currentSong.duration}** seconds long`, 60 | }) 61 | .catch((err) => {}) 62 | .then((interaction) => { 63 | setTimeout(() => interaction.delete().catch((err) => {}), 10000) 64 | }) 65 | } 66 | 67 | await queue.seek(seconds) 68 | 69 | await interaction 70 | .editReply({ 71 | content: `🎵 | Seeked to ${seconds} seconds!`, 72 | }) 73 | .catch((err) => {}) 74 | .then((interaction) => { 75 | setTimeout(() => interaction.delete().catch((err) => {}), 10000) 76 | }) 77 | } 78 | -------------------------------------------------------------------------------- /src/Commands/Interaction/Fun/rps.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, EmbedBuilder } = require("discord.js") 2 | const wait = require("node:timers/promises").setTimeout 3 | 4 | module.exports.category = "Fun" 5 | 6 | module.exports.data = new SlashCommandBuilder() 7 | .setName("rps") 8 | .setDescription("Play rock paper scissors against me!") 9 | .addStringOption((option) => 10 | option 11 | .setName("choice") 12 | .setDescription("What will you pick?") 13 | .setRequired(true) 14 | .addChoices( 15 | { name: "rock", value: "rock" }, 16 | { name: "paper", value: "paper" }, 17 | { name: "scissors", value: "scissors" } 18 | ) 19 | ) 20 | 21 | module.exports.run = async ({ client, interaction, defaultColor }) => { 22 | const userChoice = interaction.options.getString("choice") 23 | 24 | const choices = ["rock", "paper", "scissors"] 25 | const botChoice = choices[Math.floor(Math.random() * choices.length)] 26 | 27 | try { 28 | await interaction.editReply({ 29 | content: "Rock,", 30 | }) 31 | 32 | await wait(1000) 33 | 34 | await interaction.editReply({ 35 | content: "Rock, paper,", 36 | }) 37 | 38 | await wait(1000) 39 | 40 | await interaction.editReply({ 41 | content: "Rock, paper, scissors,", 42 | }) 43 | 44 | await wait(1000) 45 | 46 | await interaction.editReply({ 47 | content: "Rock, paper, scissors, shoot!", 48 | }) 49 | 50 | await wait(500) 51 | 52 | await interaction.editReply({ 53 | content: `Rock, paper, scissors, shoot!\n\nYou choose ${userChoice}!\nI choose ${botChoice}!`, 54 | }) 55 | 56 | await wait(1000) 57 | 58 | switch (userChoice + botChoice) { 59 | case "rockscissors": 60 | case "paperrock": 61 | case "scissorspaper": 62 | return await interaction.editReply({ 63 | content: `Rock, paper, scissors, shoot!\n\nYou choose ${userChoice}!\nI choose ${botChoice}!\n\nCrap, you win!`, 64 | }) 65 | case "rockpaper": 66 | case "paperscissors": 67 | case "scissorsrock": 68 | return await interaction.editReply({ 69 | content: `Rock, paper, scissors, shoot!\n\nYou choose ${userChoice}!\nI choose ${botChoice}!\n\nHa, I win!`, 70 | }) 71 | default: 72 | return await interaction.editReply({ 73 | content: `Rock, paper, scissors, shoot!\n\nYou choose ${userChoice}!\nI choose ${botChoice}!\n\n...huh, let's play again!`, 74 | }) 75 | } 76 | } catch (err) {} 77 | } 78 | -------------------------------------------------------------------------------- /src/Utilities/message-filter.js: -------------------------------------------------------------------------------- 1 | const { ChannelType, EmbedBuilder } = require("discord.js") 2 | 3 | module.exports.run = async ({ client, Systems, Infraction, logChannel }) => { 4 | client.on("messageCreate", async (message) => { 5 | const getMessageFilterandAutoWarn = await Systems.findOne({ 6 | where: { system: "Message Filter & Auto Warn" }, 7 | }) 8 | 9 | if (getMessageFilterandAutoWarn.online === false) return 10 | 11 | if (message.channel.type === ChannelType.DM) return 12 | if ( 13 | message.author.id === "527285622809952256" || // mezmer 14 | message.author.id === client.user.id // dashi 15 | ) 16 | return 17 | 18 | const lowercase = message.content.toLowerCase() 19 | const blacklistedPhrases = ["polack"] 20 | 21 | const contains = blacklistedPhrases.some((element) => { 22 | if (lowercase.includes(element)) { 23 | return true 24 | } 25 | 26 | return null 27 | }) 28 | 29 | if (!contains) return 30 | 31 | await message.delete().catch((err) => {}) 32 | 33 | const member = message.member 34 | const user = message.author 35 | 36 | const currentTime = Date.now() 37 | 38 | const randomId = Math.floor(Math.random() * 8989000) + 1010000 39 | 40 | await Infraction.create({ 41 | memberid: member.id, 42 | infractionid: randomId, 43 | warnerid: client.user.id, 44 | time: currentTime, 45 | nature: "Bad word usage", 46 | }) 47 | 48 | await member 49 | .send( 50 | `<@${member.id}> Warning! The message you just sent contains a word/phrase not allowed in Eoic Gamer Server. This is the message you sent:\n${message.content}` 51 | ) 52 | .catch((err) => { 53 | console.log(err) 54 | }) 55 | 56 | const embed = new EmbedBuilder() 57 | .setColor("Red") 58 | .setAuthor({ 59 | name: `${user.tag} has been warned`, 60 | iconURL: member.displayAvatarURL(), 61 | }) 62 | .setDescription( 63 | `Reason: **Bad word usage**\nMessage content: ${message.content}\nIssued By: <@${client.user.id}>` 64 | ) 65 | .setThumbnail( 66 | "https://images.emojiterra.com/twitter/v14.0/512px/26a0.png" 67 | ) 68 | .setFooter({ text: `Infraction ID: ${randomId}` }) 69 | .setTimestamp() 70 | 71 | const logs = await client.channels.cache.get(logChannel) 72 | 73 | return logs 74 | .send({ 75 | embeds: [embed], 76 | }) 77 | .catch((err) => { 78 | console.log(err) 79 | }) 80 | }) 81 | } 82 | -------------------------------------------------------------------------------- /src/Commands/Interaction/Waifus/breakup.js: -------------------------------------------------------------------------------- 1 | const { 2 | SlashCommandBuilder, 3 | EmbedBuilder, 4 | ActionRowBuilder, 5 | ButtonBuilder, 6 | } = require("discord.js") 7 | const Sequelize = require("sequelize") 8 | 9 | module.exports.category = "Waifus" 10 | 11 | module.exports.data = new SlashCommandBuilder() 12 | .setName("breakup") 13 | .setDescription("Break up with your current waifu") 14 | 15 | module.exports.run = async ({ client, interaction, Waifus, defaultColor }) => { 16 | const getUser = await Waifus.findOne({ 17 | where: { id: interaction.member.id }, 18 | }) 19 | 20 | if (getUser) { 21 | const existingWaifu = getUser.waifu 22 | 23 | const embed = new EmbedBuilder() 24 | .setTitle( 25 | `Are you sure you want to break up with **${existingWaifu}**?` 26 | ) 27 | .setColor(defaultColor) 28 | 29 | const row = new ActionRowBuilder().addComponents( 30 | new ButtonBuilder() 31 | .setLabel("Yes") 32 | .setStyle("Primary") 33 | .setCustomId(`breakup`) 34 | ) 35 | 36 | const response = await interaction 37 | .editReply({ 38 | embeds: [embed], 39 | components: [row], 40 | }) 41 | .catch((err) => {}) 42 | 43 | const filter = (i) => { 44 | return i.user.id === interaction.user.id 45 | } 46 | 47 | const collector = await response.createMessageComponentCollector({ 48 | filter, 49 | max: 1, 50 | time: 10000, 51 | }) 52 | 53 | collector.on("collect", async (i) => { 54 | const getNewUser = await Waifus.findOne({ 55 | where: { id: interaction.member.id }, 56 | }) 57 | 58 | if (!getNewUser) return 59 | 60 | const command = i.customId 61 | 62 | if (command !== `breakup`) return 63 | 64 | const newExistingWaifu = getNewUser.waifu 65 | 66 | await Waifus.destroy( 67 | { where: { id: interaction.member.id } }, 68 | { truncate: true } 69 | ) 70 | 71 | await i 72 | .reply({ 73 | content: `You broke up with **${newExistingWaifu}**`, 74 | }) 75 | .catch((err) => {}) 76 | }) 77 | 78 | collector.on("end", async (i) => { 79 | row.components[0].setDisabled(true) 80 | 81 | await response 82 | .edit({ 83 | components: [row], 84 | }) 85 | .catch((err) => {}) 86 | }) 87 | } else if (!getUser) { 88 | return await interaction 89 | .editReply({ 90 | content: "You don't have a waifu to break up with lol", 91 | }) 92 | .catch((err) => {}) 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /src/Commands/Interaction/Music/remove.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder } = require("discord.js") 2 | 3 | module.exports.category = "Music" 4 | 5 | module.exports.data = new SlashCommandBuilder() 6 | .setName("remove") 7 | .setDescription("Removes a song # from the queue") 8 | .addIntegerOption((option) => 9 | option 10 | .setName("songnumber") 11 | .setDescription("The song to remove") 12 | .setMinValue(1) 13 | .setRequired(true) 14 | ) 15 | 16 | module.exports.run = async ({ client, interaction, Systems, defaultColor }) => { 17 | const getMusic = await Systems.findOne({ 18 | where: { system: "Music" }, 19 | }) 20 | 21 | if (getMusic.online === false) { 22 | return await interaction 23 | .editReply({ 24 | content: "The Music system is currently disabled", 25 | }) 26 | .catch((err) => {}) 27 | } 28 | 29 | if (interaction.channel.id !== "1150910175516041266") { 30 | return await interaction 31 | .editReply({ 32 | content: 33 | "You can only use that command in <#1150910175516041266>! (this message will autodelete)", 34 | }) 35 | .catch((err) => {}) 36 | .then((interaction) => { 37 | setTimeout(() => interaction.delete().catch((err) => {}), 6000) 38 | }) 39 | } 40 | 41 | const queue = await client.distube.getQueue(interaction.guildId) 42 | 43 | if (!queue) { 44 | return await interaction 45 | .editReply({ 46 | content: "There are no songs in the queue", 47 | }) 48 | .catch((err) => {}) 49 | .then((interaction) => { 50 | setTimeout(() => interaction.delete().catch((err) => {}), 10000) 51 | }) 52 | } 53 | 54 | const trackNum = interaction.options.getInteger("songnumber") 55 | 56 | if (trackNum > queue.songs.length - 1) { 57 | return await interaction 58 | .editReply({ 59 | content: `Invalid track number. There exists only ${ 60 | queue.songs.length - 1 61 | } songs in the queue`, 62 | }) 63 | .catch((err) => {}) 64 | .then((interaction) => { 65 | setTimeout(() => interaction.delete().catch((err) => {}), 10000) 66 | }) 67 | } 68 | 69 | const song = queue.songs[trackNum] 70 | 71 | await queue.songs.splice(trackNum, 1) 72 | 73 | await interaction 74 | .editReply({ 75 | content: `Removed song #${trackNum} — **${song.name}** — from the queue.`, 76 | }) 77 | .catch((err) => {}) 78 | .then((interaction) => { 79 | setTimeout(() => interaction.delete().catch((err) => {}), 15000) 80 | }) 81 | } 82 | -------------------------------------------------------------------------------- /src/Commands/Interaction/Economy/inventory.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, EmbedBuilder } = require("discord.js") 2 | const sequelize = require("sequelize") 3 | 4 | module.exports.category = "Economy" 5 | 6 | module.exports.data = new SlashCommandBuilder() 7 | .setName("inventory") 8 | .setDescription( 9 | "View the inventory of yourself or another user; leave blank to view your own inventory" 10 | ) 11 | .addUserOption((option) => 12 | option 13 | .setName("user") 14 | .setDescription("User to check the balance of") 15 | .setRequired(false) 16 | ) 17 | 18 | module.exports.run = async ({ 19 | client, 20 | interaction, 21 | Systems, 22 | Items, 23 | defaultColor, 24 | }) => { 25 | const getEconomy = await Systems.findOne({ 26 | where: { system: "Economy" }, 27 | }) 28 | 29 | if (getEconomy.online === false) { 30 | return await interaction 31 | .editReply({ 32 | content: "The Economy system is currently disabled", 33 | }) 34 | .catch((err) => {}) 35 | } 36 | 37 | const member = interaction.options.getMember("user") || interaction.member 38 | 39 | const oneTimeItemsData = await Items.findAll({ 40 | where: { memberid: member.id, itemid: { [sequelize.Op.not]: "101" } }, 41 | }) 42 | 43 | let oneTimeItems = [] 44 | 45 | for (let obj of oneTimeItemsData) { 46 | oneTimeItems.push(obj) 47 | } 48 | 49 | const embed = new EmbedBuilder() 50 | .setColor(defaultColor) 51 | .setTitle(`${member.displayName}'s Inventory`) 52 | .setThumbnail( 53 | member.user.displayAvatarURL({ size: 4096, dynamic: true }) 54 | ) 55 | 56 | oneTimeItems = oneTimeItems.sort(function (b, a) { 57 | return b.itemid - a.itemid 58 | }) 59 | 60 | let desc = "" 61 | 62 | for (let i = 0; i < oneTimeItems.length; i++) { 63 | const itemName = oneTimeItems[i].item 64 | 65 | desc += `**${itemName}**\n` 66 | } 67 | 68 | if (!desc) { 69 | return await interaction 70 | .editReply({ 71 | embeds: [ 72 | new EmbedBuilder() 73 | .setColor(defaultColor) 74 | .setTitle(`${member.displayName}'s Inventory`) 75 | .setDescription(`Nothing but empty in here`) 76 | .setThumbnail( 77 | member.user.displayAvatarURL({ 78 | size: 4096, 79 | dynamic: true, 80 | }) 81 | ), 82 | ], 83 | }) 84 | .catch((err) => {}) 85 | } 86 | 87 | embed.setDescription(desc) 88 | 89 | await interaction 90 | .editReply({ 91 | embeds: [embed], 92 | }) 93 | .catch((err) => {}) 94 | } 95 | -------------------------------------------------------------------------------- /src/Events/Client/channelUpdate.js: -------------------------------------------------------------------------------- 1 | const { EmbedBuilder, ChannelType } = require("discord.js") 2 | 3 | module.exports = { 4 | name: "channelUpdate", 5 | async run(client, oldChannel, newChannel, defaultColor, logChannel) { 6 | const logs = await client.channels.cache.get(logChannel) 7 | const auditLog = await newChannel.guild.fetchAuditLogs() 8 | const logEntry = auditLog.entries.first() 9 | const { executor } = logEntry 10 | 11 | // console.log(oldChannel) 12 | // console.log(newChannel) 13 | 14 | const embed = new EmbedBuilder() 15 | .setTitle("🌼 Channel Update") 16 | .setDescription( 17 | `<#${newChannel.id}>\nUpdated by: <@${executor.id}>` 18 | ) 19 | .setColor(defaultColor) 20 | .setTimestamp() 21 | 22 | if (oldChannel.name !== newChannel.name) { 23 | embed.addFields({ 24 | name: "Channel Name Changed", 25 | value: `**#${oldChannel.name}** -> **#${newChannel.name}**`, 26 | }) 27 | } 28 | if (oldChannel.type !== newChannel.type) { 29 | if ( 30 | oldChannel.type === ChannelType.GuildText && 31 | newChannel.type === ChannelType.AnnouncementThread 32 | ) { 33 | embed.addFields({ 34 | name: "Channel Type Changed", 35 | value: "TextChannel -> NewsChannel", 36 | }) 37 | } else if ( 38 | oldChannel.type === ChannelType.AnnouncementThread && 39 | newChannel.type === ChannelType.GuildText 40 | ) { 41 | embed.addFields({ 42 | name: "Channel Type Changed", 43 | value: "NewsChannel -> TextChannel", 44 | }) 45 | } 46 | } 47 | if (oldChannel.topic !== newChannel.topic) { 48 | if (!oldChannel.topic) { 49 | embed.addFields({ 50 | name: "Channel Topic Added", 51 | value: `Topic:\n**${newChannel.topic}**`, 52 | }) 53 | } else if (!newChannel.topic) { 54 | embed.addFields({ 55 | name: "Channel Topic Removed", 56 | value: `**${oldChannel.topic}**\n->\n(none)`, 57 | }) 58 | } else { 59 | embed.addFields({ 60 | name: "Channel Topic Changed", 61 | value: `**${oldChannel.topic}**\n->\n**${newChannel.topic}**`, 62 | }) 63 | } 64 | } 65 | if (oldChannel.nsfw !== newChannel.nsfw) { 66 | embed.addFields({ 67 | name: "Channel NSFW Changed", 68 | value: `**${oldChannel.nsfw}** -> **${newChannel.nsfw}**`, 69 | }) 70 | } 71 | 72 | if (embed.data.fields) { 73 | await logs 74 | .send({ 75 | embeds: [embed], 76 | }) 77 | .catch((err) => { 78 | console.log(err) 79 | }) 80 | } 81 | }, 82 | } 83 | -------------------------------------------------------------------------------- /src/Commands/Interaction/Fun/text.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder } = require("discord.js") 2 | 3 | module.exports.category = "Fun" 4 | 5 | module.exports.data = new SlashCommandBuilder() 6 | .setName("text") 7 | .setDescription("Text effects") 8 | .addSubcommand((subcommand) => 9 | subcommand 10 | .setName("bent") 11 | .setDescription("bent") 12 | .addStringOption((option) => 13 | option 14 | .setName("text") 15 | .setDescription("Enter text") 16 | .setRequired(true) 17 | ) 18 | ) 19 | 20 | module.exports.run = async ({ client, interaction }) => { 21 | const Options = interaction.options.getSubcommand() 22 | 23 | switch (Options) { 24 | case "bent": { 25 | const text = interaction.options.getString("text") 26 | 27 | return await interaction 28 | .editReply({ 29 | content: bent(text), 30 | }) 31 | .catch((err) => {}) 32 | } 33 | } 34 | } 35 | 36 | const map = { 37 | a: "\u0105", 38 | b: "\u048d", 39 | c: "\u00e7", 40 | d: "\u056a", 41 | e: "\u04bd", 42 | f: "\u0192", 43 | g: "\u0581", 44 | h: "\u0570", 45 | i: "\u00ec", 46 | j: "\u029d", 47 | k: "\u049f", 48 | l: "\u04c0", 49 | m: "\u028d", 50 | n: "\u0572", 51 | o: "\u0585", 52 | p: "\u0584", 53 | q: "\u0566", 54 | r: "\u027e", 55 | s: "\u0282", 56 | t: "\u0567", 57 | u: "\u0574", 58 | v: "\u0475", 59 | w: "\u0561", 60 | x: "\u00d7", 61 | y: "\u057e", 62 | z: "\u0540", 63 | A: "\u023a", 64 | B: "\u03b2", 65 | C: "\u21bb", 66 | D: "\u13a0", 67 | E: "\u0190", 68 | F: "\u0191", 69 | G: "\u0193", 70 | H: "\u01f6", 71 | I: "\u012f", 72 | J: "\u0644", 73 | K: "\u04a0", 74 | L: "\ua748", 75 | M: "\u2c6e", 76 | N: "\u17a0", 77 | O: "\u0da7", 78 | P: "\u03c6", 79 | Q: "\u04a8", 80 | R: "\u0f60", 81 | S: "\u03da", 82 | T: "\u0372", 83 | U: "\u0531", 84 | V: "\u1efc", 85 | W: "\u0c1a", 86 | X: "\u10ef", 87 | Y: "\u04cb", 88 | Z: "\u0240", 89 | 0: "\u2298", 90 | 1: "\ud835\udfd9", 91 | 2: "\u03e9", 92 | 3: "\u04e0", 93 | 4: "\u096b", 94 | 5: "\u01bc", 95 | 6: "\u03ec", 96 | 7: "7", 97 | 8: "\ud835\udfe0", 98 | 9: "\u096f", 99 | "&": "\u214b", 100 | "(": "{", 101 | ")": "}", 102 | "{": "(", 103 | "}": ")", 104 | } 105 | function bent(str) { 106 | let c = "" 107 | for (let a, d = 0, e = str.length; d < e; d++) { 108 | ;(a = map[str.charAt(d)]), 109 | typeof a == "undefined" && (a = str.charAt(d)), 110 | (c += a) 111 | } 112 | return c 113 | } 114 | -------------------------------------------------------------------------------- /src/Commands/Interaction/Info/weather.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, EmbedBuilder } = require("discord.js") 2 | const fetch = require("node-fetch") 3 | const { openWeatherMapAPIKey } = process.env 4 | 5 | module.exports.category = "Info" 6 | 7 | module.exports.data = new SlashCommandBuilder() 8 | .setName("weather") 9 | .setDescription("Get weather information") 10 | .addStringOption((option) => 11 | option 12 | .setName("location") 13 | .setDescription("The location to get weather information for") 14 | .setRequired(true) 15 | ) 16 | 17 | module.exports.run = async ({ client, interaction }) => { 18 | const location = interaction.options.getString("location") 19 | 20 | const URL = `https://api.openweathermap.org/data/2.5/weather?q=${encodeURIComponent( 21 | location 22 | )}&appid=${openWeatherMapAPIKey}&units=imperial` 23 | 24 | try { 25 | const response = await fetch(URL) 26 | const data = await response.json() 27 | 28 | if (response.status !== 200) { 29 | return await interaction 30 | .editReply({ 31 | content: "❌ | Error: Location not found/Bad response", 32 | }) 33 | .catch((err) => {}) 34 | } 35 | 36 | const embed = new EmbedBuilder() 37 | .setColor("#0099ff") 38 | .setTitle(`Weather in ${data.name}`) 39 | .setDescription(`Current weather: ${data.weather[0].description}`) 40 | .addFields( 41 | { 42 | name: "Temperature", 43 | value: `${data.main.temp}°F`, 44 | inline: true, 45 | }, 46 | { 47 | name: "Feels like", 48 | value: `${data.main.feels_like}°F`, 49 | inline: true, 50 | }, 51 | { 52 | name: "Min Temperature", 53 | value: `${data.main.temp_min}°F`, 54 | inline: true, 55 | }, 56 | { 57 | name: "Max Temperature", 58 | value: `${data.main.temp_max}°F`, 59 | inline: true, 60 | }, 61 | { 62 | name: "Pressure", 63 | value: `${data.main.pressure} hPa`, 64 | inline: true, 65 | }, 66 | { 67 | name: "Humidity", 68 | value: `${data.main.humidity}%`, 69 | inline: true, 70 | }, 71 | { 72 | name: "Visibility", 73 | value: `${data.visibility} m`, 74 | inline: true, 75 | }, 76 | { 77 | name: "Wind direction at speed", 78 | value: `${data.wind.deg} at ${data.wind.speed} mph`, 79 | inline: true, 80 | } 81 | ) 82 | .setFooter({ text: "OpenWeatherMap" }) 83 | 84 | await interaction.editReply({ embeds: [embed] }).catch((err) => {}) 85 | } catch (error) { 86 | console.error(error) 87 | interaction 88 | .editReply({ 89 | content: "❌ | An error occurred", 90 | }) 91 | .catch((err) => {}) 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /src/Commands/Interaction/Context/Info.js: -------------------------------------------------------------------------------- 1 | const { 2 | ContextMenuCommandBuilder, 3 | ApplicationCommandType, 4 | EmbedBuilder, 5 | } = require("discord.js") 6 | 7 | module.exports.category = "Context" 8 | 9 | module.exports.data = new ContextMenuCommandBuilder() 10 | .setName("Info") 11 | .setType(ApplicationCommandType.User) 12 | 13 | module.exports.run = async ({ client, interaction, Infraction }) => { 14 | const { guild, targetId } = interaction 15 | 16 | const target = await guild.members.cache.get(targetId) 17 | 18 | const avatar = target.user.displayAvatarURL({ size: 4096, dynamic: true }) 19 | 20 | const createdTime = new Date( 21 | target.user.createdTimestamp + 5 * 3600000 22 | ).toLocaleString() 23 | 24 | const joinedTime = new Date( 25 | target.joinedTimestamp + 5 * 3600000 26 | ).toLocaleString() 27 | 28 | const nick = target.nickname ? target.nickname : target.user.username 29 | 30 | const boostingTime = target.premiumSinceTimestamp 31 | ? new Date(target.premiumSinceTimestamp + 6 * 3600000).toLocaleString() 32 | : "Not boosting" 33 | 34 | const bot = target.user.bot === true ? "Yes" : "No" 35 | 36 | const infractionData = await Infraction.findAll({ 37 | where: { memberid: target.id }, 38 | }) 39 | 40 | let infractions = [] 41 | 42 | for (let obj of infractionData) { 43 | infractions.push(obj) 44 | } 45 | 46 | const embed = new EmbedBuilder() 47 | .setColor("Random") 48 | .setAuthor({ name: `${target.user.tag}`, iconURL: `${avatar}` }) 49 | .addFields( 50 | { name: "User ID", value: `${target.id}`, inline: true }, 51 | { name: "Server Nickname", value: `${nick}`, inline: true }, 52 | { name: "Bot", value: `${bot}`, inline: true }, 53 | { 54 | name: "Account Created at", 55 | value: `${createdTime}`, 56 | inline: true, 57 | }, 58 | { 59 | name: "Joined Server at", 60 | value: `${joinedTime}`, 61 | inline: true, 62 | }, 63 | { 64 | name: "Highest Role", 65 | value: `${target.roles.highest}`, 66 | inline: true, 67 | }, 68 | { 69 | name: "Boosting Server Since", 70 | value: `${boostingTime}`, 71 | inline: true, 72 | }, 73 | { 74 | name: "Infractions", 75 | value: `${infractions.length}`, 76 | inline: true, 77 | } 78 | ) 79 | .setThumbnail(avatar) 80 | 81 | const memberPerms = (await target.permissions).toArray() 82 | 83 | if (memberPerms.length > 0) { 84 | const perms = memberPerms.join(", ") 85 | embed.addFields({ 86 | name: "Server Permissions", 87 | value: `${perms}`, 88 | inline: false, 89 | }) 90 | } 91 | 92 | await interaction 93 | .editReply({ 94 | embeds: [embed], 95 | }) 96 | .catch((err) => {}) 97 | } 98 | -------------------------------------------------------------------------------- /src/Commands/Interaction/Fun/pokemon.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, EmbedBuilder } = require("discord.js") 2 | const fetch = require("node-fetch") 3 | 4 | module.exports.category = "Fun" 5 | 6 | module.exports.data = new SlashCommandBuilder() 7 | .setName("pokemon") 8 | .setDescription("View a Pokémon's stats") 9 | .addStringOption((option) => 10 | option 11 | .setName("pokémon") 12 | .setDescription("The pokémon to search for") 13 | .setRequired(true) 14 | ) 15 | 16 | module.exports.run = async ({ client, interaction }) => { 17 | const pokemon = interaction.options.getString("pokémon") 18 | 19 | async function getPokemon(pokemon) { 20 | const baseURL = "https://pokeapi.co/api/v2/pokemon/" 21 | let response = await fetch(`${baseURL}/${pokemon}`) 22 | 23 | return await response.json().catch((err) => {}) 24 | } 25 | 26 | const pokeData = await getPokemon(pokemon) 27 | 28 | if (!pokeData) { 29 | return await interaction 30 | .editReply({ 31 | content: `❌ | No result for **${pokemon}**`, 32 | }) 33 | .catch((err) => {}) 34 | } 35 | 36 | const { 37 | name, 38 | id, 39 | sprites, 40 | base_experience, 41 | weight, 42 | height, 43 | types, 44 | stats, 45 | abilities, 46 | } = pokeData 47 | 48 | function capitalizeFirstLetter(string) { 49 | return string.charAt(0).toUpperCase() + string.slice(1) 50 | } 51 | 52 | const embed = new EmbedBuilder() 53 | .setColor("Random") 54 | .setTitle(`${capitalizeFirstLetter(name)} #${id}`) 55 | .setThumbnail(`${sprites.front_default}`) 56 | 57 | let typesArray = [] 58 | types.forEach((type) => typesArray.push(type.type.name)) 59 | const typesInfo = typesArray.join(", ") 60 | 61 | const TypeOrTypes = typesArray.length > 1 ? "Types" : "Type" 62 | 63 | let abilitiesArray = [] 64 | abilities.forEach((ability) => abilitiesArray.push(ability.ability.name)) 65 | const abilitiesInfo = abilitiesArray.join(", ") 66 | 67 | const AbilityOrAbilities = 68 | abilitiesArray.length > 1 ? "Abilities" : "Ability" 69 | 70 | embed.addFields( 71 | { name: "Base Experience", value: `${base_experience}`, inline: true }, 72 | { name: "Weight", value: `${weight}`, inline: true }, 73 | { name: "Height", value: `${height}`, inline: true }, 74 | { name: TypeOrTypes, value: typesInfo }, 75 | { 76 | name: AbilityOrAbilities, 77 | value: `${abilitiesInfo}\n——————————\n**Stats**`, 78 | } 79 | ) 80 | 81 | stats.forEach((stat) => 82 | embed.addFields({ 83 | name: capitalizeFirstLetter(stat.stat.name), 84 | value: `${stat.base_stat}`, 85 | inline: true, 86 | }) 87 | ) 88 | 89 | await interaction 90 | .editReply({ 91 | embeds: [embed], 92 | }) 93 | .catch((err) => {}) 94 | } 95 | -------------------------------------------------------------------------------- /src/Commands/Interaction/Music/loop.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, EmbedBuilder } = require("discord.js") 2 | 3 | module.exports.category = "Music" 4 | 5 | module.exports.data = new SlashCommandBuilder() 6 | .setName("loop") 7 | .setDescription("Set loop mode") 8 | .addIntegerOption((option) => 9 | option 10 | .setName("mode") 11 | .setDescription("The loop type") 12 | .setRequired(true) 13 | .addChoices( 14 | { name: "Off", value: 0 }, 15 | { name: "Song", value: 1 }, 16 | { name: "Queue", value: 2 } 17 | ) 18 | ) 19 | 20 | module.exports.run = async ({ client, interaction, Systems, defaultColor }) => { 21 | const getMusic = await Systems.findOne({ 22 | where: { system: "Music" }, 23 | }) 24 | 25 | if (getMusic.online === false) { 26 | return await interaction 27 | .editReply({ 28 | content: "The Music system is currently disabled", 29 | }) 30 | .catch((err) => {}) 31 | } 32 | 33 | if (interaction.channel.id !== "1150910175516041266") { 34 | return await interaction 35 | .editReply({ 36 | content: 37 | "You can only use that command in <#1150910175516041266>! (this message will autodelete)", 38 | }) 39 | .catch((err) => {}) 40 | .then((interaction) => { 41 | setTimeout(() => interaction.delete().catch((err) => {}), 6000) 42 | }) 43 | } 44 | 45 | const queue = await client.distube.getQueue(interaction.guildId) 46 | 47 | if (!queue) { 48 | return await interaction 49 | .editReply({ 50 | content: "There are no songs in the queue", 51 | }) 52 | .catch((err) => {}) 53 | .then((interaction) => { 54 | setTimeout(() => interaction.delete().catch((err) => {}), 10000) 55 | }) 56 | } 57 | 58 | const input = interaction.options.getInteger("mode") 59 | 60 | let loopMode = await queue.setRepeatMode(input) 61 | 62 | loopMode = loopMode 63 | ? loopMode === 2 64 | ? "Repeat queue" 65 | : "Repeat song" 66 | : "Off" 67 | 68 | return await interaction 69 | .editReply({ 70 | content: `🔁 | Set loop mode to \`${loopMode}\``, 71 | }) 72 | .catch((err) => {}) 73 | .then((interaction) => { 74 | setTimeout(() => interaction.delete().catch((err) => {}), 10000) 75 | }) 76 | 77 | // const mode = 78 | // loopMode === QueueRepeatMode.TRACK 79 | // ? "🔂" 80 | // : loopMode === QueueRepeatMode.QUEUE 81 | // ? "🔁" 82 | // : "▶" 83 | 84 | // await interaction 85 | // .editReply({ 86 | // content: success 87 | // ? `${mode} | Updated loop mode` 88 | // : "Hm, I couldn't update the loop mode... maybe it's already set to what you selected", 89 | // }) 90 | // .catch((err) => {}) 91 | // .then((interaction) => { 92 | // setTimeout(() => interaction.delete().catch((err) => {}), 10000) 93 | // }) 94 | } 95 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | .pnpm-debug.log* 9 | 10 | # Diagnostic reports (https://nodejs.org/api/report.html) 11 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 12 | 13 | # Runtime data 14 | pids 15 | *.pid 16 | *.seed 17 | *.pid.lock 18 | 19 | # Directory for instrumented libs generated by jscoverage/JSCover 20 | lib-cov 21 | 22 | # Coverage directory used by tools like istanbul 23 | coverage 24 | *.lcov 25 | 26 | # nyc test coverage 27 | .nyc_output 28 | 29 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 30 | .grunt 31 | 32 | # Bower dependency directory (https://bower.io/) 33 | bower_components 34 | 35 | # node-waf configuration 36 | .lock-wscript 37 | 38 | # Compiled binary addons (https://nodejs.org/api/addons.html) 39 | build/Release 40 | 41 | # Dependency directories 42 | node_modules/ 43 | jspm_packages/ 44 | 45 | # Snowpack dependency directory (https://snowpack.dev/) 46 | web_modules/ 47 | 48 | # TypeScript cache 49 | *.tsbuildinfo 50 | 51 | # Optional npm cache directory 52 | .npm 53 | 54 | # Optional eslint cache 55 | .eslintcache 56 | 57 | # Optional stylelint cache 58 | .stylelintcache 59 | 60 | # Microbundle cache 61 | .rpt2_cache/ 62 | .rts2_cache_cjs/ 63 | .rts2_cache_es/ 64 | .rts2_cache_umd/ 65 | 66 | # Optional REPL history 67 | .node_repl_history 68 | 69 | # Output of 'npm pack' 70 | *.tgz 71 | 72 | # Yarn Integrity file 73 | .yarn-integrity 74 | 75 | # dotenv environment variable files 76 | .env 77 | .env.development.local 78 | .env.test.local 79 | .env.production.local 80 | .env.local 81 | 82 | # parcel-bundler cache (https://parceljs.org/) 83 | .cache 84 | .parcel-cache 85 | 86 | # Next.js build output 87 | .next 88 | out 89 | 90 | # Nuxt.js build / generate output 91 | .nuxt 92 | dist 93 | 94 | # Gatsby files 95 | .cache/ 96 | # Comment in the public line in if your project uses Gatsby and not Next.js 97 | # https://nextjs.org/blog/next-9-1#public-directory-support 98 | # public 99 | 100 | # vuepress build output 101 | .vuepress/dist 102 | 103 | # vuepress v2.x temp and cache directory 104 | .temp 105 | .cache 106 | 107 | # Serverless directories 108 | .serverless/ 109 | 110 | # FuseBox cache 111 | .fusebox/ 112 | 113 | # DynamoDB Local files 114 | .dynamodb/ 115 | 116 | # TernJS port file 117 | .tern-port 118 | 119 | # Stores VSCode versions used for testing VSCode extensions 120 | .vscode-test 121 | 122 | # yarn v2 123 | .yarn/cache 124 | .yarn/unplugged 125 | .yarn/build-state.yml 126 | .yarn/install-state.gz 127 | .pnp.* 128 | 129 | # Other 130 | Unused Files/ 131 | *.sqlite 132 | *.traineddata 133 | -------------------------------------------------------------------------------- /src/Commands/Interaction/Economy/pay.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, EmbedBuilder } = require("discord.js") 2 | 3 | module.exports.category = "Economy" 4 | 5 | module.exports.data = new SlashCommandBuilder() 6 | .setName("pay") 7 | .setDescription("Pay Dashcoins to another user") 8 | .addUserOption((option) => 9 | option 10 | .setName("user") 11 | .setDescription("The user you want to pay") 12 | .setRequired(true) 13 | ) 14 | .addIntegerOption((option) => 15 | option 16 | .setName("amount") 17 | .setDescription("The amount to give") 18 | .setMinValue(1) 19 | .setMaxValue(5000) 20 | .setRequired(true) 21 | ) 22 | 23 | module.exports.run = async ({ client, interaction, Systems, Economy }) => { 24 | const getEconomy = await Systems.findOne({ 25 | where: { system: "Economy" }, 26 | }) 27 | 28 | if (getEconomy.online === false) { 29 | return await interaction 30 | .editReply({ 31 | content: "The Economy system is currently disabled", 32 | }) 33 | .catch((err) => {}) 34 | } 35 | 36 | const amount = interaction.options.getInteger("amount") 37 | const member = interaction.options.getMember("user") 38 | 39 | const getUser = 40 | (await Economy.findOne({ 41 | where: { id: interaction.member.id }, 42 | })) || 43 | (await Economy.create({ 44 | id: interaction.member.id, 45 | wallet: 0, 46 | bank: 0, 47 | })) 48 | 49 | if (member.id === interaction.member.id) { 50 | return await interaction 51 | .editReply({ content: "Did you just try to pay yourself 🤦‍♂️" }) 52 | .catch((err) => {}) 53 | } 54 | 55 | if (getUser.wallet < amount) { 56 | return await interaction 57 | .editReply({ content: "Insufficient wallet balance" }) 58 | .catch((err) => {}) 59 | } 60 | 61 | const memberWallet = 62 | (await Economy.findOne({ where: { id: member.id } })) || 63 | (await Economy.create({ 64 | id: member.id, 65 | wallet: 0, 66 | bank: 0, 67 | })) 68 | 69 | const newRecieverWallet = memberWallet.wallet + amount 70 | const newSenderWallet = getUser.wallet - amount 71 | 72 | await Economy.update( 73 | { wallet: newRecieverWallet }, 74 | { where: { id: member.id } } 75 | ) 76 | await Economy.update( 77 | { wallet: newSenderWallet }, 78 | { where: { id: interaction.member.id } } 79 | ) 80 | 81 | const dashcoinOrDashcoins = amount === 1 ? "Dashcoin" : "Dashcoins" 82 | 83 | const embed = new EmbedBuilder() 84 | .setTitle("💸 Coin transfer complete 💸") 85 | .setDescription( 86 | `**${interaction.member.displayName}** has sent **${amount}** ${dashcoinOrDashcoins}:tm: to **${member.displayName}**!` 87 | ) 88 | .setColor("Green") 89 | // .setThumbnail( 90 | // member.user.displayAvatarURL({ size: 4096, dynamic: true }) 91 | // ) 92 | 93 | await interaction 94 | .editReply({ 95 | embeds: [embed], 96 | }) 97 | .catch((err) => {}) 98 | } 99 | -------------------------------------------------------------------------------- /src/Commands/Interaction/Info/rank.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, EmbedBuilder } = require("discord.js") 2 | const wait = require("node:timers/promises").setTimeout 3 | 4 | module.exports.category = "Info" 5 | 6 | module.exports.data = new SlashCommandBuilder() 7 | .setName("rank") 8 | .setDescription( 9 | "View your or another user's rank; leave blank to view your own" 10 | ) 11 | .addUserOption((option) => 12 | option 13 | .setName("user") 14 | .setDescription("User to view the avatar of") 15 | .setRequired(false) 16 | ) 17 | 18 | module.exports.run = async ({ client, interaction, basicxp }) => { 19 | const member = interaction.options.getMember("user") || interaction.member 20 | 21 | if (member.user.bot) { 22 | return await interaction 23 | .editReply({ 24 | content: "Bots aren't allowed in the super fancy XP system", 25 | }) 26 | .catch((err) => {}) 27 | } 28 | 29 | const xpData = 30 | (await basicxp.findOne({ where: { memberid: member.id } })) || 31 | (await basicxp.create({ memberid: member.id, xp: 0, level: 1 })) 32 | 33 | const currentXP = xpData.xp 34 | const currentLevel = xpData.level 35 | const nextLevelXP = currentLevel * 100 36 | 37 | const data = await basicxp.findAll({}) 38 | 39 | const members = data.filter((obj) => 40 | interaction.guild.members.cache 41 | .map((member) => member.id) 42 | .includes(obj.memberid) 43 | ) 44 | 45 | members.sort((a, b) => b.level - a.level) 46 | 47 | // members.filter((value) => value.level > 1) 48 | 49 | let pos = 0 50 | let memberpos 51 | 52 | for (const obj of members) { 53 | pos++ 54 | 55 | if (obj.memberid === member.id) { 56 | memberpos = pos 57 | } 58 | } 59 | 60 | await interaction 61 | .editReply({ 62 | files: [ 63 | { 64 | attachment: `https://vacefron.nl/api/rankcard?username=${ 65 | member.user.username 66 | } 67 | &avatar=${member.displayAvatarURL({ 68 | size: 4096, 69 | })} 70 | &level=${currentLevel} 71 | &rank=${memberpos} 72 | ¤txp=${currentXP} 73 | &nextLevelXP=${nextLevelXP} 74 | &previouslevelxp=0 75 | &custombg=https://cdn.discordapp.com/attachments/945527434655187006/996265759577743470/unknown.png 76 | &xpcolor=9BDBF5 77 | &isboosting=false`, 78 | name: "rank.png", 79 | }, 80 | ], 81 | }) 82 | .catch((err) => {}) 83 | } 84 | 85 | // "https://vacefron.nl/api/rankcard?username=$username&avatar=$authorAvatar&level=8&rank=2¤txp=350&nextLevelXP=400&previouslevelxp=150&custombg=https://cdn.discordapp.com/attachments/740416020761804821/741310178330148894/1596811604088.png&xpcolor=FFFFFF&isboosting=true" 86 | 87 | // "https://api.no-api-key.com/api/v2/rank/2?current=$getUserVar[EXPVARIABLE]&total=$getUserVar[EXPLIMITVARIABLE]&rank=$getUserVar[RANKVARIABLE]&level=$getUserVar[LEVELVARIABLE]&discrim=$discriminator[$authorID]&username=$replaceText[$username; ;+;-1]&avatar=$authorAvatar?size=4096&status=dnd&barFill=gray&mainColor=white] 88 | // $color[$random[111111;999999]" 89 | -------------------------------------------------------------------------------- /src/Commands/Interaction/Context/ImageSauce.js: -------------------------------------------------------------------------------- 1 | const { 2 | ContextMenuCommandBuilder, 3 | ApplicationCommandType, 4 | EmbedBuilder, 5 | } = require("discord.js") 6 | 7 | module.exports.category = "Context" 8 | 9 | module.exports.data = new ContextMenuCommandBuilder() 10 | .setName("ImageSauce") 11 | .setType(ApplicationCommandType.Message) 12 | 13 | module.exports.run = async ({ client, interaction, defaultColor }) => { 14 | const { targetId } = interaction 15 | 16 | const target = await interaction.channel.messages.fetch(targetId) 17 | 18 | let embeds = [] 19 | 20 | function createEmbeds(item, type, url) { 21 | const embed = new EmbedBuilder() 22 | .setColor(defaultColor) 23 | .setURL(url) 24 | .addFields( 25 | { 26 | name: "‎", 27 | value: `[Bing](https://www.bing.com/images/searchbyimage?cbir=sbi&imgurl=${url})`, 28 | inline: true, 29 | }, 30 | { 31 | name: "‎", 32 | value: `[Google](https://www.google.com/searchbyimage?sbisrc=1&image_url=${url})`, 33 | inline: true, 34 | }, 35 | { 36 | name: "‎", 37 | value: `[Google Lens](https://lens.google.com/uploadbyurl?url=${url})`, 38 | inline: true, 39 | }, 40 | { 41 | name: "‎", 42 | value: `[ImgOps](https://imgops.com/specialized+reverse/${url})`, 43 | inline: true, 44 | }, 45 | { 46 | name: "‎", 47 | value: `[IQDB](https://iqdb.org/?url=${url})`, 48 | inline: true, 49 | }, 50 | { 51 | name: "‎", 52 | value: `[Reddit](http://karmadecay.com/search?q=${url})`, 53 | inline: true, 54 | }, 55 | { 56 | name: "‎", 57 | value: `[SauceNAO](https://saucenao.com/search.php?db=999&url=${url})`, 58 | inline: true, 59 | }, 60 | { 61 | name: "‎", 62 | value: `[TinEye](https://tineye.com/search?url=${url})`, 63 | inline: true, 64 | }, 65 | { 66 | name: "‎", 67 | value: `[Yandex](https://yandex.com/images/search?url=${url}&rpt=imageview)`, 68 | inline: true, 69 | } 70 | ) 71 | .setThumbnail(url) 72 | 73 | if (type === "attachment") { 74 | embed.setTitle(item.name) 75 | } else if (type === "embed") { 76 | embed.setTitle("Media") 77 | } 78 | 79 | embeds.push(embed) 80 | } 81 | 82 | const messageAttachments = target.attachments.toJSON() 83 | 84 | messageAttachments.forEach((item) => { 85 | if (item.contentType.startsWith("image/")) { 86 | createEmbeds(item, "attachment", item.url) 87 | } 88 | }) 89 | 90 | const messageEmbeds = target.embeds 91 | 92 | messageEmbeds.forEach((item) => { 93 | if (item.data.type === "image") { 94 | createEmbeds(item, "embed", item.data.url) 95 | } 96 | }) 97 | 98 | if (embeds.length === 0) { 99 | return await interaction 100 | .editReply({ 101 | content: "Message must contain image(s) (videos unsupported)", 102 | }) 103 | .catch((err) => {}) 104 | } 105 | 106 | await interaction 107 | .editReply({ 108 | embeds: embeds, 109 | }) 110 | .catch((err) => {}) 111 | } 112 | -------------------------------------------------------------------------------- /src/Commands/Interaction/Music/previous.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, EmbedBuilder } = require("discord.js") 2 | 3 | module.exports.category = "Music" 4 | 5 | module.exports.data = new SlashCommandBuilder() 6 | .setName("previous") 7 | .setDescription("Plays the previous song") 8 | 9 | module.exports.run = async ({ client, interaction, Systems, defaultColor }) => { 10 | const getMusic = await Systems.findOne({ 11 | where: { system: "Music" }, 12 | }) 13 | 14 | if (getMusic.online === false) { 15 | return await interaction 16 | .editReply({ 17 | content: "The Music system is currently disabled", 18 | }) 19 | .catch((err) => {}) 20 | } 21 | 22 | if (interaction.channel.id !== "1150910175516041266") { 23 | return await interaction 24 | .editReply({ 25 | content: 26 | "You can only use that command in <#1150910175516041266>! (this message will autodelete)", 27 | }) 28 | .catch((err) => {}) 29 | .then((interaction) => { 30 | setTimeout(() => interaction.delete().catch((err) => {}), 6000) 31 | }) 32 | } 33 | 34 | const queue = await client.distube.getQueue(interaction.guildId) 35 | 36 | if (!queue) { 37 | return await interaction 38 | .editReply({ 39 | content: "There are no songs in the queue", 40 | }) 41 | .catch((err) => {}) 42 | .then((interaction) => { 43 | setTimeout(() => interaction.delete().catch((err) => {}), 10000) 44 | }) 45 | } 46 | 47 | const currentSong = queue.songs[0] 48 | 49 | if (currentSong.user.id !== interaction.member.id) { 50 | if (currentSong.user.id !== client.user.id) { 51 | if (interaction.member.id !== "527285622809952256") { 52 | // const Member = Guild.members.cache.get("UserID") 53 | return await interaction 54 | .editReply({ 55 | content: "Only the user who added the song may skip it", 56 | }) 57 | .catch((err) => {}) 58 | .then((interaction) => { 59 | setTimeout( 60 | () => interaction.delete().catch((err) => {}), 61 | 10000 62 | ) 63 | }) 64 | } 65 | } 66 | } 67 | 68 | try { 69 | const song = await queue.previous() 70 | 71 | return await interaction 72 | .editReply({ 73 | embeds: [ 74 | new EmbedBuilder() 75 | .setColor(defaultColor) 76 | .setDescription( 77 | `Reverted back to playing the previous song: **${song.name}**` 78 | ) 79 | .setThumbnail(song.thumbnail), 80 | ], 81 | }) 82 | .catch((err) => {}) 83 | .then((interaction) => { 84 | setTimeout(() => interaction.delete().catch((err) => {}), 15000) 85 | }) 86 | } catch { 87 | await queue.stop() 88 | 89 | return await interaction 90 | .editReply({ 91 | embeds: [ 92 | new EmbedBuilder() 93 | .setColor(defaultColor) 94 | .setDescription( 95 | `${currentSong.name} was previous'd! No more songs in the queue, bye!` 96 | ) 97 | .setThumbnail(currentSong.thumbnail), 98 | ], 99 | }) 100 | .catch((err) => {}) 101 | .then((interaction) => { 102 | setTimeout(() => interaction.delete().catch((err) => {}), 15000) 103 | }) 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /src/Utilities/birthdays.js: -------------------------------------------------------------------------------- 1 | const { EmbedBuilder } = require("discord.js") 2 | const cron = require("node-cron") 3 | 4 | module.exports.run = async ({ client, Systems, Birthday }) => { 5 | const guilds = client.guilds.cache 6 | 7 | cron.schedule( 8 | "0 8 * * *", 9 | () => { 10 | guilds.forEach(async (g) => { 11 | const data = await Birthday.findAll({ where: { Guild: g.id } }) 12 | 13 | if (!data) return 14 | 15 | data.forEach(async (b) => { 16 | const announcements = await client.channels.cache.get( 17 | process.env.announcementsChannel 18 | ) 19 | 20 | const member = 21 | g.members.cache.get(b.User) || "Unknown User #0000" 22 | const day = b.Day 23 | const month = b.Month 24 | const year = b.Year 25 | 26 | const date = new Date() 27 | const currentDay = date.getDate() 28 | const currentMonth = date.getMonth() + 1 29 | const currentYear = date.getFullYear() 30 | 31 | function toOrdinalSuffix(num) { 32 | const int = parseInt(num), 33 | digits = [int % 10, int % 100], 34 | ordinals = ["st", "nd", "rd", "th"], 35 | oPattern = [1, 2, 3, 4], 36 | tPattern = [11, 12, 13, 14, 15, 16, 17, 18, 19] 37 | 38 | return oPattern.includes(digits[0]) && 39 | !tPattern.includes(digits[1]) 40 | ? int + ordinals[digits[0] - 1] 41 | : int + ordinals[3] 42 | } 43 | 44 | const currentDate = date.getDay() 45 | 46 | const firstDate = new Date(currentYear, month - 1, day) 47 | const secondDate = new Date( 48 | currentYear, 49 | currentMonth - 1, 50 | currentDate 51 | ) 52 | 53 | const oneDay = 24 * 60 * 60 * 1000 54 | 55 | const diffDays = Math.round( 56 | (firstDate - secondDate) / oneDay 57 | ) 58 | 59 | let dayCount = 365 60 | 61 | if (new Date(currentYear, 1, 29).getDate() === 29) { 62 | dayCount = 366 63 | } 64 | 65 | let remDays = diffDays 66 | let wishYear = currentYear 67 | 68 | if (diffDays <= 0) { 69 | remDays = diffDays + dayCount 70 | wishYear = currentYear + 1 71 | } 72 | 73 | const age = toOrdinalSuffix(wishYear - year) 74 | 75 | const embed = new EmbedBuilder() 76 | .setColor("#9BDBF5") 77 | .setDescription( 78 | `Today is ${member}'s **${age}** birthday! 🎂` 79 | ) 80 | 81 | if (month === currentMonth && day === currentDay) { 82 | const getBirthdays = await Systems.findOne({ 83 | where: { system: "Birthdays" }, 84 | }) 85 | 86 | if (getBirthdays.online === false) return 87 | 88 | announcements 89 | .send({ 90 | content: `@everyone`, 91 | embeds: [embed], 92 | }) 93 | .catch((err) => { 94 | console.log(err) 95 | }) 96 | .then((msg) => { 97 | msg.react("🎂").catch((err) => { 98 | console.log(err) 99 | }) 100 | }) 101 | } 102 | }) 103 | }) 104 | }, 105 | { 106 | scheduled: true, 107 | timezone: "America/Montreal", 108 | // timezone: "America/Bahia_Banderas" 109 | } 110 | ) 111 | } 112 | -------------------------------------------------------------------------------- /src/Commands/Interaction/Music/skip.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, EmbedBuilder } = require("discord.js") 2 | 3 | module.exports.category = "Music" 4 | 5 | module.exports.data = new SlashCommandBuilder() 6 | .setName("skip") 7 | .setDescription("Skips the current song") 8 | 9 | module.exports.run = async ({ client, interaction, Systems, defaultColor }) => { 10 | const getMusic = await Systems.findOne({ 11 | where: { system: "Music" }, 12 | }) 13 | 14 | if (getMusic.online === false) { 15 | return await interaction 16 | .editReply({ 17 | content: "The Music system is currently disabled", 18 | }) 19 | .catch((err) => {}) 20 | } 21 | 22 | if (interaction.channel.id !== "1150910175516041266") { 23 | return await interaction 24 | .editReply({ 25 | content: 26 | "You can only use that command in <#1150910175516041266>! (this message will autodelete)", 27 | }) 28 | .catch((err) => {}) 29 | .then((interaction) => { 30 | setTimeout(() => interaction.delete().catch((err) => {}), 6000) 31 | }) 32 | } 33 | 34 | const queue = await client.distube.getQueue(interaction.guildId) 35 | 36 | if (!queue) { 37 | return await interaction 38 | .editReply({ 39 | content: "There are no songs in the queue", 40 | }) 41 | .catch((err) => {}) 42 | .then((interaction) => { 43 | setTimeout(() => interaction.delete().catch((err) => {}), 10000) 44 | }) 45 | } 46 | 47 | const currentSong = queue.songs[0] 48 | 49 | // if (currentSong.user.id !== interaction.member.id) { 50 | // if (currentSong.user.id !== client.user.id) { 51 | // if (interaction.member.id !== "527285622809952256") { 52 | // // const Member = Guild.members.cache.get("UserID") 53 | // return await interaction 54 | // .editReply({ 55 | // content: "Only the user who added the song may skip it", 56 | // }) 57 | // .catch((err) => {}) 58 | // .then((interaction) => { 59 | // setTimeout( 60 | // () => interaction.delete().catch((err) => {}), 61 | // 10000 62 | // ) 63 | // }) 64 | // } 65 | // } 66 | // } 67 | 68 | try { 69 | const song = await queue.skip() 70 | 71 | return await interaction 72 | .editReply({ 73 | embeds: [ 74 | new EmbedBuilder() 75 | .setColor(defaultColor) 76 | .setDescription( 77 | `**${currentSong.name}** was skipped!\nNow playing: **${song.name}**` 78 | ) 79 | .setThumbnail(song.thumbnail), 80 | ], 81 | }) 82 | .catch((err) => {}) 83 | .then((interaction) => { 84 | setTimeout(() => interaction.delete().catch((err) => {}), 15000) 85 | }) 86 | } catch { 87 | await queue.stop() 88 | 89 | return await interaction 90 | .editReply({ 91 | embeds: [ 92 | new EmbedBuilder() 93 | .setColor(defaultColor) 94 | .setDescription( 95 | `${currentSong.name} was skipped! No more songs in the queue, bye!` 96 | ) 97 | .setThumbnail(currentSong.thumbnail), 98 | ], 99 | }) 100 | .catch((err) => {}) 101 | .then((interaction) => { 102 | setTimeout(() => interaction.delete().catch((err) => {}), 15000) 103 | }) 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /src/Commands/Interaction/Fun/animegirl.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, EmbedBuilder } = require("discord.js") 2 | const fetch = require("node-fetch") 3 | 4 | module.exports.category = "Fun" 5 | 6 | module.exports.data = new SlashCommandBuilder() 7 | .setName("animegirl") 8 | .setDescription("Pick a random anime girl image!") 9 | .addStringOption((option) => 10 | option 11 | .setName("type") 12 | .setDescription("SFW/NSFW; default is SFW") 13 | .setRequired(false) 14 | .addChoices( 15 | { name: "SFW", value: "sfw" }, 16 | { name: "NSFW", value: "nsfw" } 17 | ) 18 | ) 19 | // .addStringOption( 20 | // (option) => 21 | // option 22 | // .setName("category") 23 | // .setDescription("The category to choose from") 24 | // .setRequired(false) 25 | // .addChoices( 26 | // { name: "waifu", value: "waifu" }, 27 | // { name: "neko", value: "neko" } 28 | // // { name: "shinobu", value: "shinobu" }, 29 | // // { name: "megumin", value: "megumin" }, 30 | // // { name: "bully", value: "bully" }, 31 | // // { name: "cuddle", value: "cuddle" } 32 | // ) 33 | // ) 34 | // .addStringOption((option) => 35 | // option 36 | // .setName("search-query") 37 | // .setDescription("The search phrases") 38 | // .setRequired(true) 39 | // ) 40 | 41 | module.exports.run = async ({ client, interaction, defaultColor }) => { 42 | const type = interaction.options.getString("type") || "sfw" 43 | 44 | if (type === "nsfw" && interaction.channel.id !== "947275856919810048") { 45 | return await interaction 46 | .editReply({ 47 | content: 48 | "You can only use the NSFW option in <#947275856919810048>", 49 | }) 50 | .catch((err) => {}) 51 | } 52 | 53 | let categories = [ 54 | "waifu", 55 | "neko", 56 | "shinobu", 57 | "megumin", 58 | "bully", 59 | "cuddle", 60 | "cry", 61 | "hug", 62 | "awoo", 63 | "kiss", 64 | "lick", 65 | "pat", 66 | "smug", 67 | "bonk", 68 | "yeet", 69 | "blush", 70 | "yeet", 71 | "blush", 72 | "smile", 73 | "wave", 74 | "highfive", 75 | "handhold", 76 | "nom", 77 | "bite", 78 | "glomp", 79 | "slap", 80 | "kill", 81 | "kick", 82 | "happy", 83 | "wink", 84 | "poke", 85 | "dance", 86 | ] 87 | 88 | if (type === "nsfw") { 89 | categories = ["waifu", "neko", "trap", "blowjob"] 90 | } 91 | 92 | const category = 93 | // interaction.options.getString("category") || 94 | categories[Math.floor(Math.random() * categories.length)] 95 | 96 | async function getImageData() { 97 | const baseURL = "https://api.waifu.pics/" 98 | 99 | let response = await fetch(`${baseURL}${type}/${category}`) 100 | 101 | return await response.json().catch((err) => {}) 102 | } 103 | 104 | const imageData = await getImageData() 105 | 106 | function capitalizeFirstLetter(string) { 107 | return string.charAt(0).toUpperCase() + string.slice(1) 108 | } 109 | 110 | const Embed = new EmbedBuilder() 111 | .setColor("Random") 112 | .setTitle(`Category: ${capitalizeFirstLetter(category)}`) 113 | .setImage(imageData.url) 114 | 115 | await interaction 116 | .editReply({ 117 | embeds: [Embed], 118 | }) 119 | .catch((err) => {}) 120 | } 121 | -------------------------------------------------------------------------------- /src/Utilities/xp.js: -------------------------------------------------------------------------------- 1 | const { ChannelType } = require("discord.js") 2 | 3 | const blacklistedchannels = [ 4 | "945527434655187006", // #spam 5 | // "1003814223845015702", // #counting 6 | // "965445390465892432", // #talking-in-gif-only 7 | // "947275856919810048", // #unpure 8 | // "969027553878749204", // #nerd 9 | // "970812606287859722", // #weeb 10 | // "970859343849349160", // #og 11 | // "964714582402826280", // #fun-questions 12 | // "983507823965114378", // #bot-suggestions 13 | "992630810186367016", // #song-requests 14 | ] 15 | 16 | const { 17 | blacklistedCategories, 18 | } = require("../blacklisted-channels-and-categories") 19 | 20 | module.exports.run = async ({ client, basicxp, Systems }) => { 21 | client.on("messageCreate", async (message) => { 22 | const getXP = await Systems.findOne({ 23 | where: { system: "XP" }, 24 | }) 25 | 26 | if (getXP.online === false) return 27 | 28 | if (message.channel.type === ChannelType.DM) return 29 | if (message.author.bot) return 30 | if (message.channel.id === "945527434655187006") return 31 | if ( 32 | blacklistedchannels.includes(message.channel.id) || 33 | blacklistedCategories.includes(message.channel.parent.id) || 34 | message.channel.type === "GUILD_PUBLIC_THREAD" 35 | ) 36 | return 37 | 38 | const { member } = message 39 | 40 | function getNeededXP(level) { 41 | return level * 100 42 | } 43 | 44 | async function addXP(memberID, xpToAdd, message) { 45 | try { 46 | let xpdata = await basicxp.findOne({ 47 | where: { memberid: memberID }, 48 | }) 49 | 50 | if (!xpdata) { 51 | xpdata = await basicxp.create({ 52 | memberid: memberID, 53 | xp: 0, 54 | level: 1, 55 | }) 56 | } 57 | 58 | const newxp = xpdata.xp + xpToAdd 59 | 60 | await basicxp.update( 61 | { xp: newxp }, 62 | { where: { memberid: memberID } } 63 | ) 64 | 65 | const result = await basicxp.findOne({ 66 | where: { memberid: memberID }, 67 | }) 68 | 69 | let { xp, level } = result 70 | 71 | const needed = getNeededXP(level) 72 | 73 | if (xp >= needed) { 74 | ++level 75 | xp -= needed 76 | 77 | await basicxp.update( 78 | { xp: xp, level: level }, 79 | { where: { memberid: memberID } } 80 | ) 81 | 82 | message 83 | .reply( 84 | `You are now level **${level}** with **${xp}** experience! You now need **${getNeededXP( 85 | level 86 | )}** XP to level up again` 87 | ) 88 | .catch((err) => {}) 89 | } 90 | } catch (err) { 91 | console.log(err) 92 | } 93 | } 94 | 95 | let XPToAdd 96 | 97 | if (message.content.length < 2) { 98 | XPToAdd = Math.floor(Math.random() * 3) + 1 // 1–3 99 | } else if (message.content.length <= 5) { 100 | XPToAdd = Math.floor(Math.random() * 7) + 1 // 1–7 101 | } else if (message.content.length <= 10) { 102 | XPToAdd = Math.floor(Math.random() * 15) + 6 // 5–20 103 | } else if (message.content.length > 10) { 104 | XPToAdd = Math.floor(Math.random() * 25) + 9 // 8–33 105 | } 106 | 107 | if (message.channel.id !== "939674946953682976") { 108 | // not #general 109 | XPToAdd = Math.round(XPToAdd * 1.3) 110 | } 111 | 112 | addXP(member.id, XPToAdd, message) 113 | }) 114 | } 115 | -------------------------------------------------------------------------------- /src/Commands/Interaction/mezmer420/setpresence.js: -------------------------------------------------------------------------------- 1 | const { 2 | SlashCommandBuilder, 3 | EmbedBuilder, 4 | ActivityType, 5 | PermissionFlagsBits, 6 | } = require("discord.js") 7 | 8 | module.exports.category = "mezmer420" 9 | 10 | module.exports.data = new SlashCommandBuilder() 11 | .setName("setpresence") 12 | .setDescription("Set my presence") 13 | .addSubcommand((subcommand) => 14 | subcommand 15 | .setName("status") 16 | .setDescription("Set my status") 17 | .addStringOption((option) => 18 | option 19 | .setName("status") 20 | .setDescription("The status to set to") 21 | .setRequired(true) 22 | .addChoices( 23 | { name: "online", value: "online" }, 24 | { name: "idle", value: "idle" }, 25 | { name: "dnd", value: "dnd" }, 26 | { name: "invisible", value: "invisible" } 27 | ) 28 | ) 29 | ) 30 | .addSubcommand((subcommand) => 31 | subcommand 32 | .setName("activity") 33 | .setDescription("Set my activity") 34 | .addIntegerOption((option) => 35 | option 36 | .setName("activity") 37 | .setDescription("The activity type to set to") 38 | .setRequired(true) 39 | .addChoices( 40 | { name: "Playing", value: ActivityType.Playing }, 41 | { name: "Listening", value: ActivityType.Listening }, 42 | { name: "Watching", value: ActivityType.Watching }, 43 | { name: "Streaming", value: ActivityType.Streaming }, 44 | { name: "Competing", value: ActivityType.Competing } 45 | ) 46 | ) 47 | .addStringOption((option) => 48 | option 49 | .setName("name") 50 | .setDescription("The activity name to set to") 51 | .setRequired(true) 52 | ) 53 | ) 54 | .setDefaultMemberPermissions(PermissionFlagsBits.Administrator) 55 | 56 | module.exports.run = async ({ client, interaction }) => { 57 | const options = interaction.options.getSubcommand() 58 | 59 | switch (options) { 60 | case "status": { 61 | const status = interaction.options.getString("status") 62 | 63 | await client.user.setStatus(status) 64 | 65 | return await interaction 66 | .editReply({ 67 | content: `✅ | Updated status to **${status}**`, 68 | }) 69 | .catch((err) => {}) 70 | } 71 | 72 | case "activity": { 73 | const activityType = interaction.options.getInteger("activity") 74 | const activityName = interaction.options.getString("name") 75 | 76 | await client.user.setActivity({ 77 | name: activityName, 78 | type: activityType, 79 | }) 80 | 81 | // Playing **e** 82 | // Listening to **e** 83 | // Watching **e** 84 | // Playing **e** (live on twitch) 85 | // Competing in **e** 86 | 87 | let activity 88 | 89 | if (activityType === ActivityType.Playing) { 90 | activity = "Playing" 91 | } else if (activityType === ActivityType.Listening) { 92 | activity = "Listening to" 93 | } else if (activityType === ActivityType.Watching) { 94 | activity = "Watching" 95 | } else if (activityType === ActivityType.Streaming) { 96 | activity = "Playing" 97 | } else if (activityType === ActivityType.Competing) { 98 | activity = "Competing in" 99 | } 100 | 101 | return await interaction 102 | .editReply({ 103 | content: `✅ | Updated activity to **${activity} ${activityName}**`, 104 | }) 105 | .catch((err) => {}) 106 | } 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /src/Commands/Interaction/Music/stop.js: -------------------------------------------------------------------------------- 1 | const { 2 | SlashCommandBuilder, 3 | EmbedBuilder, 4 | ActionRowBuilder, 5 | ButtonBuilder, 6 | } = require("discord.js") 7 | 8 | module.exports.category = "Music" 9 | 10 | module.exports.data = new SlashCommandBuilder() 11 | .setName("stop") 12 | .setDescription("Stops the music bot and clears the queue") 13 | 14 | module.exports.run = async ({ client, interaction, Systems, defaultColor }) => { 15 | const getMusic = await Systems.findOne({ 16 | where: { system: "Music" }, 17 | }) 18 | 19 | if (getMusic.online === false) { 20 | return await interaction 21 | .editReply({ 22 | content: "The Music system is currently disabled", 23 | }) 24 | .catch((err) => {}) 25 | } 26 | 27 | if (interaction.channel.id !== "1150910175516041266") { 28 | return await interaction 29 | .editReply({ 30 | content: 31 | "You can only use that command in <#1150910175516041266>! (this message will autodelete)", 32 | }) 33 | .catch((err) => {}) 34 | .then((interaction) => { 35 | setTimeout(() => interaction.delete().catch((err) => {}), 6000) 36 | }) 37 | } 38 | 39 | const queue = await client.distube.getQueue(interaction.guildId) 40 | 41 | if (!queue) { 42 | return await interaction 43 | .editReply({ content: "There is nothing in the queue" }) 44 | .catch((err) => {}) 45 | .then((interaction) => { 46 | setTimeout(() => interaction.delete().catch((err) => {}), 10000) 47 | }) 48 | } 49 | 50 | await queue.stop() 51 | 52 | const responses = [ 53 | "Bye", 54 | "Bye!", 55 | "Goodbye", 56 | "Goodbye!", 57 | "k cya", 58 | "Adios amigo", 59 | "Hasta la vista!", 60 | "bye bye!", 61 | ] 62 | const response = responses[Math.floor(Math.random() * responses.length)] 63 | 64 | await interaction 65 | .editReply({ 66 | content: response, 67 | }) 68 | .catch((err) => {}) 69 | .then((interaction) => { 70 | setTimeout(() => interaction.delete().catch((err) => {}), 15000) 71 | }) 72 | 73 | // const row = new ActionRowBuilder().addComponents( 74 | // new ButtonBuilder() 75 | // .setLabel("Confirm") 76 | // .setStyle("Primary") 77 | // .setCustomId(`quit`) 78 | // ) 79 | 80 | // const response = await interaction 81 | // .editReply({ 82 | // content: 83 | // "Confirm you wish to clear the queue and stop playing music", 84 | // components: [row], 85 | // }) 86 | // .catch((err) => {}) 87 | 88 | // setTimeout(() => response.delete().catch((err) => {}), 10500) 89 | 90 | // const filter = (i) => { 91 | // return i.user.id === interaction.user.id 92 | // } 93 | 94 | // const collector = response.createMessageComponentCollector({ 95 | // filter, 96 | // max: 1, 97 | // time: 10000, 98 | // }) 99 | 100 | // collector.on("collect", async (i) => { 101 | // if (i.customId !== `quit`) return 102 | 103 | // if (!queue) return 104 | 105 | // await queue.destroy() 106 | 107 | // await i 108 | // .reply({ 109 | // content: "Bye!", 110 | // }) 111 | // .catch((err) => {}) 112 | // .then((int) => { 113 | // setTimeout(() => int.delete().catch((err) => {}), 10000) 114 | // }) 115 | // }) 116 | 117 | // collector.on("end", async (i) => { 118 | // row.components[0].setDisabled(true) 119 | 120 | // await response 121 | // .edit({ 122 | // components: [row], 123 | // }) 124 | // .catch((err) => {}) 125 | // }) 126 | } 127 | -------------------------------------------------------------------------------- /src/Commands/Interaction/Economy/shop.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, EmbedBuilder } = require("discord.js") 2 | 3 | module.exports.category = "Economy" 4 | 5 | module.exports.data = new SlashCommandBuilder() 6 | .setName("shop") 7 | .setDescription("Open the shop") 8 | .addStringOption((option) => 9 | option 10 | .setName("page") 11 | .setDescription("Page to view") 12 | .setRequired(true) 13 | .addChoices( 14 | { name: "One-time Purchases", value: "one time" }, 15 | { name: "Stockable Itmes", value: "stockable" } 16 | ) 17 | ) 18 | 19 | module.exports.run = async ({ client, interaction, Systems, defaultColor }) => { 20 | const getEconomy = await Systems.findOne({ 21 | where: { system: "Economy" }, 22 | }) 23 | 24 | if (getEconomy.online === false) { 25 | return await interaction 26 | .editReply({ 27 | content: "The Economy system is currently disabled", 28 | }) 29 | .catch((err) => {}) 30 | } 31 | 32 | const embed = new EmbedBuilder() 33 | 34 | const page = interaction.options.getString("page") 35 | 36 | switch (page) { 37 | case "one time": { 38 | embed.setColor(defaultColor).setTitle("Shop").addFields( 39 | { 40 | name: "**About**", 41 | value: "Cost and info below each item. To buy, type `/buy`. To sell an item you own (at a reduced price of its original), type `/sell`.", 42 | }, 43 | { 44 | name: "Debit Card", 45 | value: "`1000 Dashcoins` Purchases will be made by default from your bank", 46 | }, 47 | { 48 | name: "Motorcycle", 49 | value: "`500 Dashcoins` Get places fast! Work cooldown reduced from 10 min to 7 min", 50 | }, 51 | { 52 | name: "Superbike", 53 | value: "`3500 Dashcoins` Get places super fast! Work cooldown reduced to 4 minutes", 54 | }, 55 | { 56 | name: "Hammer", 57 | value: "`1000 Dashcoins` Randomized range of Dashcoins:tm: earned from working reduced from 35 to 20 from the max", 58 | }, 59 | { 60 | name: "Sickle", 61 | value: "`1500 Dashcoins` Max Dashcoins:tm: earned from working increased from 100 to 150", 62 | }, 63 | { 64 | name: "Wife", 65 | value: "`1000 Dashcoins` Aw, a loving partner~ Chances of having a bad day at work reduced from 10% to 5%", 66 | }, 67 | { 68 | name: "Falsified College Degree", 69 | value: "`50000 Dashcoins` Because we all know you're too dum to get a real college degree. Max Dashcoins:tm: earned from working increased to 500", 70 | }, 71 | { 72 | name: "Bail Bonds", 73 | value: "`2000 Dashcoins` If you're caught robbing/heisting, eco cooldowns reduced from 1 hour to 30 min", 74 | }, 75 | { 76 | name: "Holdup Equipment", 77 | value: "`2000 Dashcoins` Increases your chances of a successful heist", 78 | } 79 | ) 80 | break 81 | } 82 | 83 | case "stockable": { 84 | embed.setColor(defaultColor).setTitle("Shop").addFields( 85 | { 86 | name: "**About**", 87 | value: "Cost and info below each item. To buy, type `/buy`. Stockable items are not sellable.", 88 | }, 89 | // { 90 | // name: "Birth Control Pills", 91 | // value: "`1000 Dashcoins` Protects against getting impregnated if you are raped", 92 | // } 93 | { 94 | name: "Noting here rn check back later :/", 95 | value: "`0 Dashcoins` qwertyuioplkjhgfdsazxcvbnm", 96 | } 97 | ) 98 | break 99 | } 100 | } 101 | 102 | await interaction 103 | .editReply({ 104 | embeds: [embed], 105 | }) 106 | .catch((err) => {}) 107 | } 108 | -------------------------------------------------------------------------------- /src/Utilities/anti-crash.js: -------------------------------------------------------------------------------- 1 | const { EmbedBuilder } = require("discord.js") 2 | 3 | module.exports.run = async ({ client, Systems }) => { 4 | const errChannel = "995340958096969869" // dashi anti-crash log dump 5 | 6 | const me = await client.users 7 | .fetch("527285622809952256") 8 | .catch(console.error) 9 | 10 | process.on("unhandledRejection", async (reason, p) => { 11 | const getAnticrash = await Systems.findOne({ 12 | where: { system: "Anti-crash Logging" }, 13 | }) 14 | 15 | if (getAnticrash.online === false) return 16 | 17 | console.log(" [Anti-crash] :: Unhandled Rejection/Catch") 18 | const current = new Date() 19 | console.log(` ${current.toLocaleString()}`) 20 | return console.log(reason, p) 21 | 22 | const errEmbed = new EmbedBuilder() 23 | .setColor("Red") 24 | .setTitle("⚠ New Error") 25 | .setDescription( 26 | "An unhandledRejection error just occured in the bot console**\n\nERROR:\n** ```" + 27 | reason + 28 | "\n\n" + 29 | p + 30 | "```" 31 | ) 32 | .setTimestamp() 33 | .setFooter({ text: "Anti-Crash System" }) 34 | 35 | const getErrChannel = await client.channels.cache.get(errChannel) 36 | 37 | getErrChannel 38 | .send({ 39 | content: "<@527285622809952256>", 40 | embeds: [errEmbed], 41 | }) 42 | .catch((err) => { 43 | console.log(err) 44 | }) 45 | }) 46 | 47 | process.on("uncaughtException", async (err, origin) => { 48 | const getAnticrash = await Systems.findOne({ 49 | where: { system: "Anti-crash Logging" }, 50 | }) 51 | 52 | if (getAnticrash.online === false) return 53 | 54 | console.log(" [Anti-crash] :: Uncaught Exception/Catch") 55 | const current = new Date() 56 | console.log(` ${current.toLocaleString()}`) 57 | return console.log(err, origin) 58 | 59 | const errEmbed = new EmbedBuilder() 60 | .setColor("Red") 61 | .setTitle("⚠ New Error") 62 | .setDescription( 63 | "An uncaughtException error just occured in the bot console**\n\nERROR:\n** ```" + 64 | err + 65 | "\n\n" + 66 | origin + 67 | "```" 68 | ) 69 | .setTimestamp() 70 | .setFooter({ text: "Anti-Crash System" }) 71 | 72 | const getErrChannel = await client.channels.cache.get(errChannel) 73 | 74 | getErrChannel 75 | .send({ 76 | content: "<@527285622809952256>", 77 | embeds: [errEmbed], 78 | }) 79 | .catch((err) => { 80 | console.log(err) 81 | }) 82 | }) 83 | 84 | process.on("uncaughtExceptionMonitor", async (err, origin) => { 85 | const getAnticrash = await Systems.findOne({ 86 | where: { system: "Anti-crash Logging" }, 87 | }) 88 | 89 | if (getAnticrash.online === false) return 90 | 91 | console.log(" [Anti-crash] :: Unhandled Exception/Catch (MONITOR)") 92 | const current = new Date() 93 | console.log(` ${current.toLocaleString()}`) 94 | return console.log(err, origin) 95 | 96 | const errEmbed = new EmbedBuilder() 97 | .setColor("Red") 98 | .setTitle("⚠ New Error") 99 | .setDescription( 100 | "An uncaughtExceptionMonitor error just occured in the bot console**\n\nERROR:\n** ```" + 101 | err + 102 | "\n\n" + 103 | origin + 104 | "```" 105 | ) 106 | .setTimestamp() 107 | .setFooter({ text: "Anti-Crash System" }) 108 | 109 | const getErrChannel = await client.channels.cache.get(errChannel) 110 | 111 | getErrChannel 112 | .send({ 113 | content: "<@527285622809952256>", 114 | embeds: [errEmbed], 115 | }) 116 | .catch((err) => { 117 | console.log(err) 118 | }) 119 | }) 120 | } 121 | -------------------------------------------------------------------------------- /src/Commands/Text/For_mez/embed.js: -------------------------------------------------------------------------------- 1 | const { EmbedBuilder } = require("discord.js") 2 | 3 | module.exports.run = async (client, message, args) => { 4 | if (message.author.id !== "527285622809952256") { 5 | return message 6 | .reply( 7 | "Only mezmer420 can use that command! (these messages will autodelete)" 8 | ) 9 | .catch((err) => {}) 10 | .then((msg) => { 11 | setTimeout(() => message.delete().catch((err) => {}), 6000) 12 | setTimeout(() => msg.delete().catch((err) => {}), 6000) 13 | }) 14 | } 15 | 16 | message.delete().catch((err) => {}) 17 | 18 | const embed = new EmbedBuilder() 19 | .setColor("#9BDBF5") 20 | .setTitle("General Update") 21 | .setDescription("**Music Bot**") 22 | .addFields({ 23 | name: "dashi now has a music bot feature—it supports YouTube URLs (Hydra doesn't)! Check it out in #song-reqs", 24 | value: "now some bad news... mezmer sacrificed the cleanliness of his index.js to bring you this feature so he is going to be spending the rest of the day cleaning it up", 25 | }) 26 | 27 | const embed2 = new EmbedBuilder() 28 | .setColor("Red") 29 | .setTitle("Speedy") 30 | .addFields({ 31 | name: '"what is dashcoin?"', 32 | value: "🤦‍♂️", 33 | }) 34 | 35 | const embed3 = new EmbedBuilder() 36 | .setColor("Green") 37 | .setTitle("Cookies") 38 | .addFields({ 39 | name: '"Oh you poor little beggar, take **1** Dashcoin:tm:"', 40 | value: "1 Dashcoin:tm: Recieved", 41 | }) 42 | 43 | const embed4 = new EmbedBuilder() 44 | .setColor("Red") 45 | .setTitle("Case #4 — choc wins") 46 | // .setDescription() 47 | .addFields({ 48 | name: "choc versus rock", 49 | value: "Punishment Appeal", 50 | }) 51 | 52 | const hydra = await client.users.fetch("547905866255433758") 53 | 54 | const execution = new EmbedBuilder() 55 | .setColor("Red") 56 | .setTitle("Execution Underway") 57 | .setDescription( 58 | "User: Hydra#1214\nReason: Redundant Bot\nMethod: Electric Chair\nExecutioner: <@826841451945787412>" 59 | ) 60 | .setThumbnail(`${hydra.displayAvatarURL()}`) 61 | // .addField("User: Hydra#1214") 62 | .setTimestamp() 63 | 64 | const oldMusicEmbed = new EmbedBuilder() 65 | .setAuthor({ 66 | name: "dashi", 67 | iconURL: client.user.displayAvatarURL({ 68 | size: 4096, 69 | dynamic: true, 70 | }), 71 | }) 72 | .setColor("#C04BF7") 73 | .setTitle("🎵 Music System 🎵") 74 | .setDescription("I can play videos under 12 minutes") 75 | .addFields({ 76 | name: "Commands", 77 | value: "`/play song` `/play playlisturl` `/quit` `/queue` `/loop` `/pause` `/resume` `/skip` `/skip-to` `/shuffle` `/filter`", 78 | inline: false, 79 | }) 80 | .setFooter({ 81 | text: "Supported platforms for /play song (using a URL):\nYouTube, SoundCloud, Spotify, Facebook, Vimeo", 82 | }) 83 | 84 | const musicEmbed = new EmbedBuilder() 85 | .setAuthor({ 86 | name: "dashi", 87 | iconURL: client.user.displayAvatarURL({ 88 | size: 4096, 89 | dynamic: true, 90 | }), 91 | }) 92 | .setColor("#C04BF7") 93 | .setTitle("🎵 Music System 🎵") 94 | // .setDescription( 95 | // "I can play videos up to an hour in length" 96 | // ) 97 | .addFields({ 98 | name: "Commands", 99 | value: "`/play song` `/play playlisturl` `/stop` `/queue` `/pause` `/resume` `/loop` `/autoplay` `/skip` `/skipto` `/previous` `/remove` `/shuffle` `/seek` `/filter`", 100 | inline: false, 101 | }) 102 | .setFooter({ 103 | text: "Supported platforms for /play song (using a URL):\nYouTube, Spotify, SoundCloud", 104 | }) 105 | 106 | message.channel 107 | .send({ 108 | embeds: [musicEmbed], 109 | }) 110 | .catch((err) => { 111 | console.log(err) 112 | }) 113 | } 114 | -------------------------------------------------------------------------------- /src/Commands/Interaction/Waifus/balls.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, EmbedBuilder } = require("discord.js") 2 | 3 | module.exports.category = "Waifus" 4 | 5 | module.exports.data = new SlashCommandBuilder() 6 | .setName("balls") 7 | .setDescription("Gives a random ball") 8 | 9 | module.exports.run = async ({ client, interaction, Systems, Waifus }) => { 10 | const getWaifus = await Systems.findOne({ 11 | where: { system: "Waifus" }, 12 | }) 13 | 14 | if (getWaifus.online === false) { 15 | return await interaction 16 | .editReply({ 17 | content: "The Waifus system is currently disabled", 18 | }) 19 | .catch((err) => {}) 20 | } 21 | 22 | const balls = ["Basketball", "Football", "Baseball", "Golf Ball"] 23 | 24 | const ball = balls[Math.floor(Math.random() * balls.length)] 25 | 26 | const embed = new EmbedBuilder().setColor("Random").setTitle(ball) 27 | 28 | switch (ball) { 29 | case "Basketball": 30 | embed 31 | .setDescription("shoot hoops") 32 | .setImage( 33 | "https://artwork.espncdn.com/categories/cd70a58e-a830-330c-93ed-52360b51b632/1x1Feature/1440_201903062023.jpg" 34 | ) 35 | break 36 | case "Football": 37 | embed 38 | .setDescription("throw it even though called football") 39 | .setImage( 40 | "https://dbukjj6eu5tsf.cloudfront.net/sidearm.sites/utepathletics.com/images/2021/6/24/DSC04844.jpg" 41 | ) 42 | break 43 | case "Baseball": 44 | embed 45 | .setDescription("hit with stick or something") 46 | .setImage( 47 | "https://images.squarespace-cdn.com/content/v1/5737bc404d088e9a0cc49199/1602379045086-OIA9DAWFOLEE16AVTQ80/image-asset.jpeg?format=1500w" 48 | ) 49 | break 50 | case "Golf Ball": 51 | embed 52 | .setDescription("swing at it to try to get in hole") 53 | .setImage( 54 | "https://ncg-live-assets.ams3.cdn.digitaloceanspaces.com/uploads/2021/02/1-Ball-in-Golf-1.jpg" 55 | ) 56 | break 57 | } 58 | 59 | const sentInteraction = await interaction 60 | .editReply({ 61 | embeds: [embed], 62 | }) 63 | .catch(async (err) => { 64 | console.log(err) 65 | 66 | return await interaction 67 | .editReply({ 68 | content: "❌ | An error occured", 69 | }) 70 | .catch((err) => {}) 71 | }) 72 | 73 | sentInteraction.react("❤️").catch((err) => {}) 74 | 75 | const filter = (reaction, user) => { 76 | return reaction.emoji.name === "❤️" && user.id === interaction.member.id 77 | } 78 | 79 | const collector = await sentInteraction.createReactionCollector({ 80 | filter, 81 | max: 1, 82 | time: 20000, 83 | }) 84 | 85 | collector.on("collect", async (reaction) => { 86 | const getUser = await Waifus.findOne({ 87 | where: { id: interaction.member.id }, 88 | }) 89 | 90 | if (!getUser) { 91 | await Waifus.create({ id: interaction.member.id, waifu: ball }) 92 | 93 | return await interaction 94 | .editReply({ 95 | content: `Aww, your new waifu is **${ball}**!`, 96 | }) 97 | .catch((err) => {}) 98 | } else if (getUser) { 99 | const existingWaifu = getUser.waifu 100 | 101 | return await interaction 102 | .editReply({ 103 | content: 104 | `You already have a waifu—**${existingWaifu}**! Use ` + 105 | "`/breakup`" + 106 | ` to break up with ${existingWaifu}`, 107 | }) 108 | .catch((err) => {}) 109 | } 110 | 111 | // console.log( 112 | // `${interaction.member.username} collected a new ${reaction.emoji.name} reaction` 113 | // ) 114 | }) 115 | 116 | collector.on("end", (collected, reason) => { 117 | return 118 | 119 | // if (reason === "limit") return console.log("limit reached") 120 | // else { 121 | // console.log("time expired") 122 | // } 123 | }) 124 | } 125 | -------------------------------------------------------------------------------- /src/Commands/Interaction/Admins/systemstoggle.js: -------------------------------------------------------------------------------- 1 | const { 2 | SlashCommandBuilder, 3 | EmbedBuilder, 4 | PermissionFlagsBits, 5 | } = require("discord.js") 6 | 7 | module.exports.category = "Admins" 8 | 9 | module.exports.data = new SlashCommandBuilder() 10 | .setName("systemstoggle") 11 | .setDescription("Modify system states") 12 | .addSubcommand((subcommand) => 13 | subcommand 14 | .setName("toggle") 15 | .setDescription("Toggle a system") 16 | .addStringOption((option) => 17 | option 18 | .setName("system") 19 | .setDescription("The system to toggle") 20 | .setRequired(true) 21 | .addChoices( 22 | { name: "XP", value: "XP" }, 23 | { name: "Dialects", value: "Dialects" }, 24 | { 25 | name: "General Responses", 26 | value: "General Responses", 27 | }, 28 | { name: "Economy", value: "Economy" }, 29 | { name: "Music", value: "Music" }, 30 | { name: "Waifus", value: "Waifus" }, 31 | { name: "Birthdays", value: "Birthdays" }, 32 | { name: "Fricking", value: "Fricking" }, 33 | { 34 | name: "Message Filter & Auto Warn", 35 | value: "Message Filter & Auto Warn", 36 | }, 37 | { name: "Crazy Suppress", value: "Crazy Suppress" }, 38 | { 39 | name: "Anti-crash Logging", 40 | value: "Anti-crash Logging", 41 | } 42 | ) 43 | ) 44 | ) 45 | .addSubcommand((subcommand) => 46 | subcommand 47 | .setName("lockdown") 48 | .setDescription("Server riot underway, cut the life support!") 49 | ) 50 | .addSubcommand((subcommand) => 51 | subcommand.setName("all").setDescription("Enable all systems") 52 | ) 53 | .addSubcommand((subcommand) => 54 | subcommand 55 | .setName("reset") 56 | .setDescription("Reset all systems to their default state") 57 | ) 58 | .setDefaultMemberPermissions(PermissionFlagsBits.Administrator) 59 | 60 | module.exports.run = async ({ client, interaction, Systems }) => { 61 | const options = interaction.options.getSubcommand() 62 | 63 | switch (options) { 64 | case "toggle": { 65 | const system = interaction.options.getString("system") 66 | 67 | const getSystem = await Systems.findOne({ 68 | where: { system: system }, 69 | }) 70 | 71 | if (getSystem.online === true) { 72 | await Systems.update( 73 | { online: false }, 74 | { where: { system: system } } 75 | ) 76 | 77 | return await interaction 78 | .editReply({ 79 | content: `**${system}** has been deactivated`, 80 | }) 81 | .catch((err) => {}) 82 | } else if (getSystem.online === false) { 83 | await Systems.update( 84 | { online: true }, 85 | { where: { system: system } } 86 | ) 87 | 88 | return await interaction 89 | .editReply({ 90 | content: `**${system}** has been enabled`, 91 | }) 92 | .catch((err) => {}) 93 | } 94 | } 95 | 96 | case "lockdown": { 97 | await Systems.update({ online: false }, { where: { online: true } }) 98 | 99 | return await interaction 100 | .editReply({ 101 | content: `Got it! Systems lockdown!`, 102 | }) 103 | .catch((err) => {}) 104 | } 105 | 106 | case "all": { 107 | await Systems.update({ online: true }, { where: { online: false } }) 108 | 109 | return await interaction 110 | .editReply({ 111 | content: "All systems now online", 112 | }) 113 | .catch((err) => {}) 114 | } 115 | 116 | case "reset": { 117 | await Systems.update({ online: true }, { where: { online: false } }) 118 | 119 | await Systems.update( 120 | { online: false }, 121 | { where: { system: "Crazy Suppress" } } 122 | ) 123 | 124 | return await interaction 125 | .editReply({ 126 | content: "All systems now reset", 127 | }) 128 | .catch((err) => {}) 129 | } 130 | } 131 | } 132 | -------------------------------------------------------------------------------- /src/Commands/Interaction/Economy/beg.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder } = require("discord.js") 2 | const ms = require("ms") 3 | 4 | module.exports.category = "Economy" 5 | 6 | module.exports.data = new SlashCommandBuilder() 7 | .setName("beg") 8 | .setDescription("Beg for Dashcoins; cooldown 1 min") 9 | 10 | module.exports.run = async ({ 11 | client, 12 | interaction, 13 | Economy, 14 | begCooldown, 15 | Systems, 16 | }) => { 17 | const getEconomy = await Systems.findOne({ 18 | where: { system: "Economy" }, 19 | }) 20 | 21 | if (getEconomy.online === false) { 22 | return await interaction 23 | .editReply({ 24 | content: "The Economy system is currently disabled", 25 | }) 26 | .catch((err) => {}) 27 | } 28 | 29 | const getBegCooldown = await begCooldown.findOne({ 30 | where: { id: interaction.member.id }, 31 | }) 32 | 33 | const begCooldownTime = getBegCooldown?.expiry 34 | 35 | if (getBegCooldown && begCooldownTime > new Date().getTime()) { 36 | return await interaction 37 | .editReply({ 38 | content: `Wait **${ms(begCooldownTime - new Date().getTime(), { 39 | long: true, 40 | })}** before trying to beg again!`, 41 | }) 42 | .catch((err) => {}) 43 | } else if (getBegCooldown) { 44 | await begCooldown.destroy({ where: { id: interaction.member.id } }) 45 | } 46 | 47 | const getUser = 48 | (await Economy.findOne({ where: { id: interaction.member.id } })) || 49 | (await Economy.create({ 50 | id: interaction.member.id, 51 | wallet: 0, 52 | bank: 0, 53 | })) 54 | 55 | // if (getUser.wallet >= 1000 && getUser.bank < 1000) { 56 | // return await interaction 57 | // .editReply({ 58 | // content: 59 | // "bruh you have at least 1000 Dashcoins:tm: in your wallet; nobody's going to donate to you lmao", 60 | // }) 61 | // .catch((err) => {}) 62 | // } else if (getUser.wallet < 1000 && getUser.bank >= 1000) { 63 | // return await interaction 64 | // .editReply({ 65 | // content: 66 | // "bruh you have at least 1000 Dashcoins:tm: in your bank; what are you doing begging lmao", 67 | // }) 68 | // .catch((err) => {}) 69 | // } else if (getUser.wallet >= 1000 && getUser.bank >= 1000) { 70 | // return await interaction 71 | // .editReply({ 72 | // content: 73 | // "bruh you have at least 1000 Dashcoins:tm: in both your wallet and bank; what are you doing begging lmao", 74 | // }) 75 | // .catch((err) => {}) 76 | // } else if (getUser.wallet < 1000 && getUser.bank < 1000) { 77 | const randomValue = Math.floor(Math.random() * 100) 78 | 79 | if (randomValue >= 20) { 80 | const coinsEarned = Math.floor(Math.random() * 5) + 5 81 | 82 | await Economy.update( 83 | { wallet: getUser.wallet + coinsEarned }, 84 | { where: { id: interaction.member.id } } 85 | ) 86 | 87 | await begCooldown.create({ 88 | id: interaction.member.id, 89 | expiry: new Date().getTime() + 30000 * 2, 90 | }) 91 | 92 | return await interaction 93 | .editReply({ 94 | content: `You recieved **${coinsEarned}** Dashcoins:tm:!`, 95 | }) 96 | .catch((err) => {}) 97 | } else if (10 <= randomValue && randomValue < 20) { 98 | const coinsEarned = Math.floor(Math.random() * 50) + 100 99 | 100 | await Economy.update( 101 | { wallet: getUser.wallet + coinsEarned }, 102 | { where: { id: interaction.member.id } } 103 | ) 104 | 105 | await begCooldown.create({ 106 | id: interaction.member.id, 107 | expiry: new Date().getTime() + 30000 * 2, 108 | }) 109 | 110 | return await interaction 111 | .editReply({ 112 | content: `Woah, was that MrBeast? You recieved **${coinsEarned}** Dashcoins:tm:!`, 113 | }) 114 | .catch((err) => {}) 115 | } else if (randomValue < 10) { 116 | await begCooldown.create({ 117 | id: interaction.member.id, 118 | expiry: new Date().getTime() + 30000 * 2, 119 | }) 120 | 121 | return await interaction 122 | .editReply({ 123 | content: 124 | "Unfortunately, nobody donated you anything. Better luck next time.", 125 | }) 126 | .catch((err) => {}) 127 | // } 128 | } 129 | } 130 | -------------------------------------------------------------------------------- /src/Commands/Interaction/Government/crazysuppress.js: -------------------------------------------------------------------------------- 1 | const { 2 | SlashCommandBuilder, 3 | EmbedBuilder, 4 | PermissionFlagsBits, 5 | } = require("discord.js") 6 | 7 | module.exports.category = "Government" 8 | 9 | module.exports.data = new SlashCommandBuilder() 10 | .setName("crazysuppress") 11 | .setDescription("View or add/remove crazy users") 12 | .addSubcommand((subcommand) => 13 | subcommand.setName("view").setDescription("View crazy users") 14 | ) 15 | .addSubcommand((subcommand) => 16 | subcommand 17 | .setName("add") 18 | .setDescription("Add a crazy user") 19 | .addUserOption((option) => 20 | option 21 | .setName("user") 22 | .setDescription("User to add as crazy") 23 | .setRequired(true) 24 | ) 25 | ) 26 | .addSubcommand((subcommand) => 27 | subcommand 28 | .setName("remove") 29 | .setDescription("Remove a crazy user") 30 | .addUserOption((option) => 31 | option 32 | .setName("user") 33 | .setDescription("User to remove as crazy") 34 | .setRequired(true) 35 | ) 36 | ) 37 | .setDefaultMemberPermissions(PermissionFlagsBits.KickMembers) 38 | 39 | module.exports.run = async ({ 40 | client, 41 | interaction, 42 | Suppress, 43 | defaultColor, 44 | }) => { 45 | const member = interaction.options.getMember("user") 46 | 47 | const options = interaction.options.getSubcommand() 48 | 49 | switch (options) { 50 | case "view": { 51 | const data = await Suppress.findAll({}) 52 | 53 | let members = [] 54 | 55 | for (let obj of data) { 56 | if ( 57 | interaction.guild.members.cache 58 | .map((member) => member.id) 59 | .includes(obj.memberid) 60 | ) { 61 | members.push(obj) 62 | } 63 | } 64 | 65 | if (members.length === 0) { 66 | return await interaction 67 | .editReply({ 68 | content: "Cool, nobody here is crazy (yet!)", 69 | }) 70 | .catch((err) => {}) 71 | } 72 | 73 | const embed = new EmbedBuilder() 74 | .setTitle("Crazy Users") 75 | .setColor(defaultColor) 76 | .setTimestamp() 77 | 78 | members = members.sort(function (b, a) { 79 | return a.memberid - b.memberid 80 | }) 81 | 82 | let pos = 0 83 | 84 | for (let obj of members) { 85 | pos++ 86 | } 87 | 88 | let desc = "" 89 | 90 | for (let i = 0; i < members.length; i++) { 91 | const user = client.users.cache.get(members[i].memberid) 92 | 93 | if (!user) return 94 | 95 | desc += `<@${user.id}>\n` 96 | } 97 | 98 | embed.setDescription(desc) 99 | 100 | return await interaction 101 | .editReply({ 102 | embeds: [embed], 103 | }) 104 | .catch((err) => {}) 105 | } 106 | 107 | case "add": { 108 | const findUser = await Suppress.findOne({ 109 | where: { memberid: member.id }, 110 | }) 111 | 112 | if (findUser) { 113 | return await interaction 114 | .editReply({ 115 | content: `<@${member.id}> is already a crazy user`, 116 | }) 117 | .catch((err) => {}) 118 | } 119 | 120 | if (member.id === client.user.id) { 121 | return await interaction 122 | .editReply({ 123 | content: "I'm not crazy!", 124 | }) 125 | .catch((err) => {}) 126 | } 127 | 128 | await Suppress.create({ 129 | memberid: member.id, 130 | }) 131 | 132 | return await interaction 133 | .editReply({ 134 | content: `<@${member.id}> has been added as a crazy user`, 135 | }) 136 | .catch((err) => {}) 137 | } 138 | 139 | case "remove": { 140 | const findUser = await Suppress.findOne({ 141 | where: { memberid: member.id }, 142 | }) 143 | 144 | if (!findUser) { 145 | return await interaction 146 | .editReply({ 147 | content: `<@${member.id}> wasn't already a crazy user`, 148 | }) 149 | .catch((err) => {}) 150 | } 151 | 152 | await Suppress.destroy({ where: { memberid: member.id } }) 153 | 154 | return await interaction 155 | .editReply({ 156 | content: `<@${member.id}> has been removed as a crazy user`, 157 | }) 158 | .catch((err) => {}) 159 | } 160 | } 161 | } 162 | -------------------------------------------------------------------------------- /src/Commands/Interaction/Government/clear.js: -------------------------------------------------------------------------------- 1 | const { 2 | SlashCommandBuilder, 3 | EmbedBuilder, 4 | PermissionFlagsBits, 5 | } = require("discord.js") 6 | 7 | module.exports.category = "Government" 8 | 9 | module.exports.data = new SlashCommandBuilder() 10 | .setName("clear") 11 | .setDescription("Delete specified messages in this channel") 12 | .addIntegerOption((option) => 13 | option 14 | .setName("number") 15 | .setDescription("The number of messages to delete") 16 | .setMinValue(1) 17 | .setRequired(true) 18 | ) 19 | .addUserOption((option) => 20 | option 21 | .setName("member") 22 | .setDescription("Delete a specific member's messages") 23 | .setRequired(false) 24 | ) 25 | .setDefaultMemberPermissions(PermissionFlagsBits.KickMembers) 26 | 27 | module.exports.run = async ({ client, interaction, defaultColor }) => { 28 | const number = interaction.options.getInteger("number") 29 | const member = interaction.options.getMember("member") 30 | 31 | const messages = await interaction.channel.messages.fetch() 32 | 33 | if (member) { 34 | let i = 0 35 | const filtered = [] 36 | ;(await messages).filter((m) => { 37 | if (m.author.id === member.id && number > i) { 38 | filtered.push(m) 39 | i++ 40 | } 41 | }) 42 | 43 | await interaction.deleteReply().catch((err) => {}) 44 | 45 | await interaction.channel.bulkDelete(filtered, true).catch((err) => { 46 | console.log(err) 47 | return interaction.channel.send("I couldn't do that") 48 | }) 49 | // .then((messages) => { 50 | // interaction.channel.send( 51 | // `<@${interaction.member.id}> 🧹 Deleted ${messages.size} messages from ${member}` 52 | // ) 53 | // }) 54 | // .then((msg) => { 55 | // console.log(msg) 56 | // setTimeout(() => msg.delete().catch((err) => {}), 6000) 57 | // }) 58 | 59 | // if (number >= 20) { 60 | // // interaction.member 61 | // // .send( 62 | // // `Warning that you just purged a large number of messages—${number}` 63 | // // ) 64 | // // .catch((err) => { 65 | // // console.log(err) 66 | // // }) 67 | 68 | // const logs = await client.channels.cache.get("955948174894325782") 69 | 70 | // const warningEmbed = new EmbedBuilder() 71 | // .setTitle(`⚠️ Large # of Messages Purged`) 72 | // .setDescription( 73 | // `# Purged: **${number}**\nPurged By: <@${interaction.member.id}>\nChannel: <#${interaction.channel.id}>` 74 | // ) 75 | // .setColor(defaultColor) 76 | // .setTimestamp() 77 | 78 | // logs.send({ 79 | // embeds: [warningEmbed], 80 | // }).catch((err) => { 81 | // console.log(err) 82 | // }) 83 | // } 84 | } else if (!member) { 85 | await interaction.deleteReply().catch((err) => {}) 86 | 87 | await interaction.channel.bulkDelete(number, true).catch((err) => { 88 | console.log(err) 89 | return interaction.channel.send("I couldn't do that") 90 | }) 91 | // .then((messages) => { 92 | // interaction.channel.send( 93 | // `<@${interaction.member.id}>🧹 Deleted ${messages.size} messages (this message will autodelete)` 94 | // ) 95 | // }) 96 | // .then((msg) => { 97 | // console.log(msg) 98 | // setTimeout(() => msg.delete().catch((err) => {}), 6000) 99 | // }) 100 | 101 | if (number >= 20) { 102 | // interaction.member 103 | // .send( 104 | // `Warning that you just purged a large number of messages—${number}` 105 | // ) 106 | // .catch((err) => { 107 | // console.log(err) 108 | // }) 109 | 110 | const logs = await client.channels.cache.get("955948174894325782") 111 | 112 | const warningEmbed = new EmbedBuilder() 113 | .setTitle(`⚠️ Large # of Messages Purged`) 114 | .setDescription( 115 | `# Purged: **${number}**\nPurged By: <@${interaction.member.id}> using ` + 116 | "`/clear`\n" + 117 | `Channel: <#${interaction.channel.id}>` 118 | ) 119 | .setColor(defaultColor) 120 | .setTimestamp() 121 | 122 | logs.send({ 123 | embeds: [warningEmbed], 124 | }).catch((err) => { 125 | console.log(err) 126 | }) 127 | } 128 | } 129 | } 130 | -------------------------------------------------------------------------------- /src/Commands/Interaction/Info/dialect.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, EmbedBuilder } = require("discord.js") 2 | 3 | module.exports.category = "Info" 4 | 5 | module.exports.data = new SlashCommandBuilder() 6 | .setName("dialect") 7 | .setDescription("View dialect info") 8 | .addStringOption((option) => 9 | option 10 | .setName("dialect") 11 | .setDescription("The dialect to view") 12 | .setRequired(true) 13 | .addChoices( 14 | { name: "vcash dialect", value: "1" }, 15 | { name: "mezmer dialect", value: "2" }, 16 | { name: "choc dialect", value: "3" }, 17 | { name: "delta airlines dialect", value: "4" }, 18 | { 19 | name: "speedy dialect uwu owu uwo ow- -w- -wu uWu", 20 | value: "5", 21 | }, 22 | { 23 | name: "vchoc dialect", 24 | value: "6", 25 | }, 26 | { 27 | name: "balls dialect", 28 | value: "7", 29 | } 30 | ) 31 | ) 32 | 33 | module.exports.run = async ({ 34 | client, 35 | interaction, 36 | Systems, 37 | Dialects, 38 | defaultColor, 39 | }) => { 40 | const getDialects = await Systems.findOne({ 41 | where: { system: "Dialects" }, 42 | }) 43 | 44 | if (getDialects.online === false) { 45 | return await interaction 46 | .editReply({ 47 | content: "The Dialects system is currently disabled", 48 | }) 49 | .catch((err) => {}) 50 | } 51 | 52 | const dialectId = interaction.options.getString("dialect") 53 | 54 | const dialectTest = await Dialects.findOne({ 55 | where: { dialectid: dialectId }, 56 | }) 57 | 58 | if (!dialectTest) { 59 | let dialectName 60 | if (dialectId === "1") { 61 | dialectName = "vcash dialect" 62 | } else if (dialectId === "2") { 63 | dialectName = "mezmer dialect" 64 | } else if (dialectId === "3") { 65 | dialectName = "choc dialect" 66 | } else if (dialectId === "4") { 67 | dialectName = "delta airlines dialect" 68 | } else if (dialectId === "5") { 69 | dialectName = "speedy dialect uwu owu uwo ow- -w- -wu uWu" 70 | } else if (dialectId === "6") { 71 | dialectName = "vchoc dialect" 72 | } else if (dialectId === "7") { 73 | dialectName = "balls dialect" 74 | } 75 | 76 | return await interaction 77 | .editReply({ 78 | content: `**${dialectName}** doesn't have any phrases yet`, 79 | }) 80 | .catch((err) => {}) 81 | } 82 | 83 | const dialectData = await Dialects.findAll({ 84 | where: { dialectid: dialectId }, 85 | }) 86 | 87 | let dialect = [] 88 | 89 | for (let obj of dialectData) { 90 | dialect.push(obj) 91 | } 92 | 93 | let dialectPhrases = [] 94 | 95 | for (let i = 0; i < dialect.length; i++) { 96 | const phrase = dialect[i].phrase 97 | 98 | dialectPhrases.push(phrase) 99 | } 100 | 101 | dialectPhrases = dialectPhrases.sort() 102 | 103 | let dialectCount = [] 104 | 105 | for (let i = 0; i < dialect.length; i++) { 106 | const count = dialect[i].count 107 | 108 | dialectCount.push(count) 109 | } 110 | 111 | dialectCount = dialectCount.reduce((a, b) => a + b, 0) 112 | 113 | const oneDialectData = await Dialects.findOne({ 114 | where: { dialectid: dialectId }, 115 | }) 116 | 117 | const embed = new EmbedBuilder() 118 | .setTitle(`${oneDialectData.dialectname}`) 119 | .setFooter({ text: `Use Count: ${dialectCount} | Since 6/30/2022` }) 120 | 121 | let desc = "" 122 | 123 | for (let i = 0; i < dialectPhrases.length; i++) { 124 | const phrase = dialectPhrases[i] 125 | 126 | desc += "`" + `${phrase}` + "`" + " " 127 | } 128 | 129 | embed.setDescription(desc) 130 | 131 | if (dialectId === "1") { 132 | embed.setColor("#FFA500") 133 | } else if (dialectId === "2") { 134 | embed.setColor("#0096FF") 135 | } else if (dialectId === "3") { 136 | embed.setColor("Red") 137 | } else if (dialectId === "4") { 138 | embed.setColor("Purple") 139 | } else if (dialectId === "5") { 140 | embed.setColor("Purple") 141 | } else if (dialectId === "6") { 142 | embed.setColor("Orange") 143 | } else if (dialectId === "7") { 144 | embed.setColor("Purple") 145 | } 146 | 147 | await interaction 148 | .editReply({ 149 | embeds: [embed], 150 | }) 151 | .catch((err) => {}) 152 | } 153 | -------------------------------------------------------------------------------- /src/Commands/Interaction/Utilities/role.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, EmbedBuilder } = require("discord.js") 2 | 3 | module.exports.category = "Utilities" 4 | 5 | module.exports.data = new SlashCommandBuilder() 6 | .setName("role") 7 | .setDescription("Configure your unique role") 8 | .addSubcommand((subcommand) => 9 | subcommand 10 | .setName("name") 11 | .setDescription("Set your unique role's name") 12 | .addStringOption((option) => 13 | option 14 | .setName("name") 15 | .setDescription("The name to set your unique role to") 16 | .setRequired(true) 17 | ) 18 | .addStringOption((option) => 19 | option 20 | .setName("id") 21 | .setDescription("ID of role to configure (mezmer420 only!)") 22 | .setRequired(false) 23 | ) 24 | ) 25 | .addSubcommand((subcommand) => 26 | subcommand 27 | .setName("color") 28 | .setDescription("Set your unique role's color") 29 | .addStringOption((option) => 30 | option 31 | .setName("hex-code") 32 | .setDescription( 33 | "The hex code to set your unique role's color to" 34 | ) 35 | .setRequired(true) 36 | ) 37 | .addStringOption((option) => 38 | option 39 | .setName("id") 40 | .setDescription("ID of role to configure (mezmer420 only!)") 41 | .setRequired(false) 42 | ) 43 | ) 44 | 45 | module.exports.run = async ({ client, interaction }) => { 46 | if ( 47 | interaction.member.id !== "527285622809952256" && // mezmer 48 | interaction.member.id !== "762133129209053244" && // vcash 49 | interaction.member.id !== "826841451945787412" && // choc 50 | interaction.member.id !== "1030771237808517170" && // tree 51 | interaction.member.id !== "691727350051635262" // speedy 52 | ) { 53 | return await interaction 54 | .editReply({ 55 | content: "Only core members have a unique role!", 56 | }) 57 | .catch((err) => {}) 58 | } 59 | 60 | if ( 61 | interaction.options.getString("ID") && 62 | interaction.member.id !== "527285622809952256" 63 | ) { 64 | return await interaction 65 | .editReply({ 66 | content: "Only mezmer420 can use this subcommand!", 67 | }) 68 | .catch((err) => {}) 69 | } 70 | 71 | let roleID 72 | 73 | if (interaction.member.id === "527285622809952256") { 74 | // mezmer 75 | roleID = "1113944873574346783" 76 | } else if (interaction.member.id === "762133129209053244") { 77 | // vcash 78 | roleID = "1113945182212206653" 79 | } else if (interaction.member.id === "826841451945787412") { 80 | // choc 81 | roleID = "1113946752769331270" 82 | } else if (interaction.member.id === "1030771237808517170") { 83 | // tree 84 | roleID = "1141429591710376057" 85 | } else if (interaction.member.id === "691727350051635262") { 86 | // speedy 87 | roleID = "1113945400802549791" 88 | } 89 | 90 | if (interaction.options.getString("id")) { 91 | roleID = interaction.options.getString("id") 92 | } 93 | 94 | const role = await interaction.guild.roles.cache.get(roleID) 95 | 96 | if (!role) { 97 | return await interaction 98 | .editReply({ 99 | content: `❌ | Couldn't find role with ID **${roleID}**`, 100 | }) 101 | .catch((err) => {}) 102 | } 103 | 104 | const options = interaction.options.getSubcommand() 105 | 106 | switch (options) { 107 | case "name": { 108 | const name = interaction.options.getString("name") 109 | 110 | try { 111 | await role.edit({ name: name }) 112 | return await interaction 113 | .editReply(`✅ | Role name is now **${name}**`) 114 | .catch((err) => {}) 115 | } catch (err) { 116 | console.log(err) 117 | return await interaction 118 | .editReply({ content: "❌ | Error" }) 119 | .catch((err) => {}) 120 | } 121 | } 122 | 123 | case "color": { 124 | const color = interaction.options.getString("hex-code") 125 | 126 | try { 127 | await role.edit({ color: color }) 128 | return await interaction 129 | .editReply(`✅ | Updated role color`) 130 | .catch((err) => {}) 131 | } catch (err) { 132 | console.log(err) 133 | return await interaction 134 | .editReply({ content: "❌ | Error" }) 135 | .catch((err) => {}) 136 | } 137 | } 138 | } 139 | } 140 | -------------------------------------------------------------------------------- /src/Commands/Interaction/Music/queue.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, EmbedBuilder } = require("discord.js") 2 | 3 | module.exports.category = "Music" 4 | 5 | module.exports.data = new SlashCommandBuilder() 6 | .setName("queue") 7 | .setDescription( 8 | "Displays the current song queue and displays info about the currently playing song" 9 | ) 10 | .addNumberOption((option) => 11 | option 12 | .setName("page") 13 | .setDescription("Page number of the queue") 14 | .setMinValue(1) 15 | .setRequired(false) 16 | ) 17 | 18 | module.exports.run = async ({ client, interaction, Systems, defaultColor }) => { 19 | const getMusic = await Systems.findOne({ 20 | where: { system: "Music" }, 21 | }) 22 | 23 | if (getMusic.online === false) { 24 | return await interaction 25 | .editReply({ 26 | content: "The Music system is currently disabled", 27 | }) 28 | .catch((err) => {}) 29 | } 30 | 31 | if (interaction.channel.id !== "1150910175516041266") { 32 | return await interaction 33 | .editReply({ 34 | content: 35 | "You can only use that command in <#1150910175516041266>! (this message will autodelete)", 36 | }) 37 | .catch((err) => {}) 38 | .then((interaction) => { 39 | setTimeout(() => interaction.delete().catch((err) => {}), 6000) 40 | }) 41 | } 42 | 43 | const queue = client.distube.getQueue(interaction.guildId) 44 | 45 | if (!queue) { 46 | return await interaction 47 | .editReply({ content: "There is nothing playing" }) 48 | .catch((err) => {}) 49 | .then((interaction) => { 50 | setTimeout(() => interaction.delete().catch((err) => {}), 10000) 51 | }) 52 | } 53 | 54 | const totalPages = Math.ceil(queue.songs.length / 10) || 1 55 | const page = (interaction.options.getNumber("page") || 1) - 1 56 | 57 | if (page + 1 > totalPages) { 58 | return await interaction 59 | .editReply({ 60 | content: `Invalid page. There exists only ${totalPages} page(s) of songs`, 61 | }) 62 | .catch((err) => {}) 63 | .then((interaction) => { 64 | setTimeout(() => interaction.delete().catch((err) => {}), 10000) 65 | }) 66 | } 67 | 68 | let queueString = queue.songs 69 | .slice(page * 10 + 1, page * 10 + 10 + 1) 70 | .map((song, i) => { 71 | return `**${page * 10 + i + 1}.** \`[${ 72 | song.formattedDuration 73 | }]\` [${song.name}](${song.url})\n${song.user}` 74 | }) 75 | .join("\n\n") 76 | 77 | if (!queueString) { 78 | queueString = "None" 79 | } 80 | 81 | const currentSong = queue.songs[0] 82 | 83 | const status = `Filters: \`${ 84 | queue.filters.names.join(", ") || "Off" 85 | }\` | Loop: \`${ 86 | queue.repeatMode ? (queue.repeatMode === 2 ? "Queue" : "Song") : "Off" 87 | }\` | Autoplay: \`${queue.autoplay ? "On" : "Off"}\`` 88 | 89 | const progressUnrounded = queue.currentTime / currentSong.duration 90 | const progress = ((queue.currentTime / currentSong.duration) * 100).toFixed( 91 | 1 92 | ) 93 | 94 | let progressInfo = `Progress: ${progress}%` 95 | 96 | if ( 97 | queue.filters.names.includes("nightcore") || 98 | queue.filters.names.includes("vaporwave") 99 | ) { 100 | progressInfo = `Progress: ${progress}% (based on original song speed)` 101 | } 102 | 103 | const progressBar = 104 | "-".repeat(Math.floor(progressUnrounded * 50)) + 105 | "🔘" + 106 | "-".repeat(50 - Math.floor(progressUnrounded * 50)) 107 | 108 | await interaction 109 | .editReply({ 110 | embeds: [ 111 | new EmbedBuilder() 112 | .setColor(defaultColor) 113 | .setDescription( 114 | `**Currently Playing**\n` + 115 | (currentSong 116 | ? `\`[${queue.formattedCurrentTime}]\`/\`[${currentSong.formattedDuration}]\` [${currentSong.name}](${currentSong.url})\n|${progressBar}|\n${progressInfo}\nRequested by ${currentSong.user}` 117 | : "None") + 118 | `\n\n**Queue**\n${queueString} 119 | \n**Settings**\n${status}` 120 | ) 121 | .setThumbnail(currentSong.thumbnail) 122 | .setFooter({ text: `Page ${page + 1} of ${totalPages}` }) 123 | .setTimestamp(), 124 | ], 125 | }) 126 | .catch((err) => {}) 127 | .then((interaction) => { 128 | setTimeout(() => interaction.delete().catch((err) => {}), 30000) 129 | }) 130 | } 131 | -------------------------------------------------------------------------------- /src/Events/Client/messageReactionAdd.js: -------------------------------------------------------------------------------- 1 | const { EmbedBuilder } = require("discord.js") 2 | 3 | module.exports = { 4 | name: "messageReactionAdd", 5 | async run(client, reaction, user, defaultColor) { 6 | if (reaction.partial) { 7 | try { 8 | await reaction.fetch() 9 | } catch (error) { 10 | return console.error( 11 | "Something went wrong fetching reaction: ", 12 | error 13 | ) 14 | } 15 | } 16 | 17 | if (user.bot) return 18 | 19 | const member = reaction.message.guild.members.cache.get(user.id) 20 | 21 | if (reaction.message.id === "964363343789961267") { 22 | if (reaction.emoji.name !== "✅") return 23 | 24 | const roleID = "957872601550716929" 25 | 26 | member.roles.add(roleID).catch((err) => { 27 | console.log("Error giving role: ", err) 28 | }) 29 | 30 | // if (member.id === "527285622809952256") { 31 | // reaction.message 32 | // .edit( 33 | // `Welcome to our small friend server! Before you can start talking, please read the rules in the <#939675214600605757> channel below. Once you read and understand them, react to the ✅ emoji below to access the server.` 34 | // ) 35 | // .catch((err) => { 36 | // console.log(err) 37 | // }) 38 | // } 39 | } 40 | // else if (reaction.message.id === "963931617276071946") { 41 | // let roleID 42 | 43 | // // if (reaction.emoji.name === "1️⃣") { 44 | // // roleID = "956642101653827674" 45 | // // } else if (reaction.emoji.name === "2️⃣") { 46 | // // roleID = "953099131797270588" 47 | // // } else if (reaction.emoji.name === "3️⃣") { 48 | // // roleID = "952349639426854973" 49 | // // } else if (reaction.emoji.name === "4️⃣") { 50 | // // roleID = "963928836356051025" 51 | // // } else if (reaction.emoji.name === "5️⃣") { 52 | // // roleID = "963933396227219497" 53 | // // } 54 | // if (reaction.emoji.name === "6️⃣") { 55 | // roleID = "964556786105475092" 56 | // } 57 | // // else if (reaction.emoji.name === "7️⃣") { 58 | // // roleID = "969432438516375603" 59 | // // } else if (reaction.emoji.name === "8️⃣") { 60 | // // roleID = "999905439615561828" 61 | // // } 62 | // else if (reaction.emoji.name === "9️⃣") { 63 | // roleID = "1000505530978152569" 64 | // } 65 | // // else if (reaction.emoji.name === "😳") { 66 | // // if (member.id !== "527285622809952256") return 67 | // // return reaction.message 68 | // // .edit( 69 | // // `Use the reactions below to opt in and out of roles.\n>>>1️⃣ <@&id> — anime lovers\n<@&id> — people who procrastinate\n3️⃣ <@&id> — cooking experts\n4️⃣ <@&id> — pinged when a fun poll is posted in <#964714582402826280>\n5️⃣ <@&id> — pinged when someone is streaming\n6️⃣ <@&id> — not able to view <#947275856919810048>\n7️⃣ <@&id> — nerds who have access to <#969027553878749204>` 70 | // // ) 71 | // // .catch((err) => { 72 | // // console.log(err) 73 | // // }) 74 | // // } 75 | // else return 76 | 77 | // if (member.roles.cache.has(roleID)) return 78 | 79 | // member.roles.add(roleID).catch((err) => { 80 | // console.log("Error giving role: ", err) 81 | // }) 82 | // } 83 | else if (reaction.message.id === "1150967763075092533") { 84 | // reaction.message.pin().catch((err) => { 85 | // console.log(err) 86 | // }) 87 | 88 | reaction.message.edit({ 89 | embeds: [ 90 | new EmbedBuilder() 91 | .setAuthor({ 92 | name: "dashi", 93 | iconURL: client.user.displayAvatarURL({ 94 | size: 4096, 95 | dynamic: true, 96 | }), 97 | }) 98 | .setColor("#C04BF7") 99 | .setTitle("🎵 Music System 🎵") 100 | // .setDescription( 101 | // "I can play videos up to an hour in length" 102 | // ) 103 | .addFields({ 104 | name: "Commands", 105 | value: "`/play song` `/play playlisturl` `/stop` `/queue` `/pause` `/resume` `/loop` `/autoplay` `/skip` `/skipto` `/previous` `/remove` `/shuffle` `/seek` `/filter`", 106 | inline: false, 107 | }) 108 | .setFooter({ 109 | text: "Supported platforms for /play song (using a URL):\nYouTube, Spotify, SoundCloud", 110 | }), 111 | ], 112 | }) 113 | } 114 | }, 115 | } 116 | --------------------------------------------------------------------------------