From 4e081358fffba7e0a61d2440ee9c3c8bed395774 Mon Sep 17 00:00:00 2001 From: ItzEmerald Date: Sat, 23 Jul 2022 07:50:12 +0100 Subject: [PATCH] v8.0-Dev-1.1 --- .DS_Store | Bin 6148 -> 10244 bytes Commands/add.js | 16 +++++-- Commands/close.js | 16 +++++-- Commands/embed.js | 16 +++++-- Commands/help.js | 37 ++++++++++------ Commands/info.js | 43 ++++++++++-------- Commands/ping.js | 16 +++++-- Commands/remove.js | 16 +++++-- Commands/suggest.js | 16 +++++-- Commands/ticket.js | 25 ++++++----- Commands/translate.js | 15 +++++-- Commands/userinfo.js | 16 +++++-- Configs/commands.yml | 85 ++++++++++++++++++++++++++++-------- Configs/supportbot.yml | 18 ++++---- Data/ticket-panel-id.json | 5 ++- Events/interactionCreate.js | 4 +- Events/ready.js | 11 ++--- 17 files changed, 256 insertions(+), 99 deletions(-) diff --git a/.DS_Store b/.DS_Store index 222dd9755078c2fec97a563fa0f24bc2d0bf88b0..644178452db8712f8ac5ac92831eefab27aa8dfe 100644 GIT binary patch literal 10244 zcmeHM-EJF26h7mI#7NGp7U)DTQ4LKQ-FoJ3%ik`PBBQCiHdcVd=oW~|+H z(l(0ZYq;V8cmpIZxIy9tcmnPaj{vv5f^TNm?RvN65GnzrX;_ zY?aD037XO{U>GnAJZ3=c4>q#GMvB7(_11wxUjcvCs_lYjt9c1WjoeFbotKPB?{FhGJcud!ex`8WYpw?uW*3iK*eh#|v#sUGVqaSh|74+THsGkN7escSP zAI0_hudH-w;)Tg6q?xIE?JwnNJ9gqh)O5lF^|XV*-I46LyFNedSPN@X#Evg`s11CN zL*?#gzVPH}Qx1d|Y1?+vP(kWg*UrvX-np@4ue^8je91n$xl&)U->uir&nx9>?XCB> zJ4eB>kY8&Gh^2cFT~3}Km)}4t_~my`Qoq=bBfoyPtkkn|WqM}z@{3ojxvTSY3v<{Q}`l7cN^ZRkzf5OzZyL2z<9&?DWi*|V!0Soqf`%V}-qQ{#L?gfs^gH6$taV(FOrs}OL#a75wPkTOOp9!6{ z#_f^tMj}|HS|SitEVd)0;FU_Pv6WVq={jcX9onTMdPv{WcbIZN(=YTJ{Xvh|6nmMy z&aSf?>;ra-eZ*SqHrryKvhBpWH2S2kj)q8(9RLfT^rRh%K#CsPl--n``hpJ0r(S;I zv)7=JT|qhR=VaRFyfTyi|32w+A2c`RCukk}d`wOz+>2eFsU0vo*(Yg(PKe_~hzkqj zQBJpv<)cmxPWNe#wXpOy=o4zAT*lesjlYjRb+R_I7(wbWI?z_q zfC7w|4O_#Hl3LnXKjx?pf4kUP94v88Z^BCIXZ@y-#rVifc{e`tcn{C8(<5i?DzpvX zR>Ak3r~9Zkn5@M#*oY~FXIZTvL+b@3GHFmMqVxRf|)&j2@` z{r~?(pu+fQ7`U(uu!;5ddK2!Cf*^S&RIJ@b{sLJgr8i7ao1oC)c%Tl)<3WYvb=(GZ jb;vqFZYTjbOb`;%zy4wxd!wdjAgc2+O diff --git a/Commands/add.js b/Commands/add.js index 6b216ff..5b32b76 100644 --- a/Commands/add.js +++ b/Commands/add.js @@ -13,8 +13,8 @@ const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8")); const Command = require("../Structures/Command.js"); module.exports = new Command({ - name: cmdconfig.TicketAdd, - description: cmdconfig.TicketAddDesc, + name: cmdconfig.TicketAdd.Command, + description: cmdconfig.TicketAdd.Description, type: Discord.ApplicationCommandType.ChatInput, options: [ { @@ -24,9 +24,19 @@ module.exports = new Command({ required: true, }, ], - permissions: ["SEND_MESSAGES"], + permissions: cmdconfig.TicketAdd.Permission, async run(interaction) { + let disableCommand = true; + + if (cmdconfig.TicketAdd.Enabled === false) { + if (interaction.type === Discord.InteractionType.ApplicationCommand && disableCommand) + return interaction.reply({ + content: ":x: This command is `disabled`", + ephemeral: true, + }); + } + const { getRole } = interaction.client; let SupportStaff = await getRole(supportbot.Staff, interaction.guild); let Admin = await getRole(supportbot.Admin, interaction.guild); diff --git a/Commands/close.js b/Commands/close.js index 25a01a4..367fb94 100644 --- a/Commands/close.js +++ b/Commands/close.js @@ -13,8 +13,8 @@ const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8")); const Command = require("../Structures/Command.js"); module.exports = new Command({ - name: cmdconfig.CloseTicket, - description: cmdconfig.CloseTicketDesc, + name: cmdconfig.CloseTicket.Command, + description: cmdconfig.CloseTicket.Description, type: Discord.ApplicationCommandType.ChatInput, options: [ { @@ -23,9 +23,19 @@ module.exports = new Command({ type: Discord.ApplicationCommandOptionType.String, }, ], - permissions: ["SEND_MESSAGES"], + permissions: cmdconfig.CloseTicket.Permission, async run(interaction) { + let disableCommand = true; + + if (cmdconfig.CloseTicket.Enabled === false) { + if (interaction.type === Discord.InteractionType.ApplicationCommand && disableCommand) + return interaction.reply({ + content: ":x: This command is `disabled`", + ephemeral: true, + }); + } + const { getRole, getChannel } = interaction.client; if (supportbot.StaffOnly) { let SupportStaff = await getRole(supportbot.Staff, interaction.guild); diff --git a/Commands/embed.js b/Commands/embed.js index b34a922..e2edbdf 100644 --- a/Commands/embed.js +++ b/Commands/embed.js @@ -13,8 +13,8 @@ const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8")); const Command = require("../Structures/Command.js"); module.exports = new Command({ - name: cmdconfig.EmbedCommand, - description: cmdconfig.EmbedCommandDesc, + name: cmdconfig.Embed.Command, + description: cmdconfig.Embed.Description, type: Discord.ApplicationCommandType.ChatInput, options: [ { @@ -67,9 +67,19 @@ module.exports = new Command({ required: false, }, ], - permissions: ["SEND_MESSAGES"], + permissions: cmdconfig.Embed.Permission, async run(interaction) { + let disableCommand = true; + + if (cmdconfig.Embed.Enabled === false) { + if (interaction.type === Discord.InteractionType.ApplicationCommand && disableCommand) + return interaction.reply({ + content: ":x: This command is `disabled`", + ephemeral: true, + }); + } + const { getRole } = interaction.client; let SupportStaff = await getRole(supportbot.Staff, interaction.guild); let Admin = await getRole(supportbot.Admin, interaction.guild); diff --git a/Commands/help.js b/Commands/help.js index 1f987ae..5762218 100644 --- a/Commands/help.js +++ b/Commands/help.js @@ -13,13 +13,23 @@ const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8")); const Command = require("../Structures/Command.js"); module.exports = new Command({ - name: cmdconfig.HelpCommand, - description: cmdconfig.HelpCommandDesc, + name: cmdconfig.Help.Command, + description: cmdconfig.Help.Description, type: Discord.ApplicationCommandType.ChatInput, options: [], - permissions: ["SEND_MESSAGES"], + permissions: cmdconfig.Help.Permission, async run(interaction) { + let disableCommand = true; + + if (cmdconfig.Help.Enabled === false) { + if (interaction.type === Discord.InteractionType.ApplicationCommand && disableCommand) + return interaction.reply({ + content: ":x: This command is `disabled`", + ephemeral: true, + }); + } + const { getRole } = interaction.client; let SupportStaff = await getRole(supportbot.Staff, interaction.guild); let Admin = await getRole(supportbot.Admin, interaction.guild); @@ -29,24 +39,23 @@ module.exports = new Command({ ); let botCommands = ""; - botCommands += `**/${cmdconfig.HelpCommand}** ${cmdconfig.HelpCommandDesc}\n`; - botCommands += `**/${cmdconfig.InfoCommand}** ${cmdconfig.InfoCommandDesc}\n`; - botCommands += `**/${cmdconfig.PingCommand}** ${cmdconfig.PingCommandDesc}\n`; - botCommands += `**/${cmdconfig.UserInfoCommand}** ${cmdconfig.UserInfoCommandDesc}\n`; + botCommands += ` \`${cmdconfig.Help.Command}\` `; + botCommands += `\`${cmdconfig.Ping.Command}\` `; + botCommands += `\`${cmdconfig.Info.Command}\` `; if (supportbot.DisableSuggestions === false) { - botCommands += `**/${cmdconfig.SuggestCommand}** ${cmdconfig.SuggestCommandDesc}\n`; + botCommands += `\`${cmdconfig.Suggestion.Command}\` `; } let ticketCommands = ""; - ticketCommands += `**/${cmdconfig.OpenTicket}** ${cmdconfig.OpenTicketDesc}\n`; - ticketCommands += `**/${cmdconfig.CloseTicket}** ${cmdconfig.CloseTicketDesc}\n`; + ticketCommands += ` \`${cmdconfig.OpenTicket.Command}\` `; + ticketCommands += `\`${cmdconfig.CloseTicket.Command}\` `; let staffCommands = ""; - staffCommands += `**/${cmdconfig.TicketAdd}** ${cmdconfig.TicketAddDesc}\n`; - staffCommands += `**/${cmdconfig.TicketRemove}** ${cmdconfig.TicketRemoveDesc}\n`; - staffCommands += `**/${cmdconfig.UserInfoCommand}** ${cmdconfig.UserInfoCommandDesc}\n`; - staffCommands += `**/${cmdconfig.TranslateCommand}** ${cmdconfig.TranslateCommandDesc}\n`; + staffCommands += ` \`${cmdconfig.TicketAdd.Command}\` `; + staffCommands += `\`${cmdconfig.TicketRemove.Command}\` `; + staffCommands += `\`${cmdconfig.UserInfo.Command}\` `; + staffCommands += `\`${cmdconfig.Translate.Command}\` `; const HelpEmbed1 = new Discord.EmbedBuilder() .setTitle(supportbot.General.Name + " Commands") diff --git a/Commands/info.js b/Commands/info.js index c2f39b8..1d6dbe4 100644 --- a/Commands/info.js +++ b/Commands/info.js @@ -13,28 +13,37 @@ const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8")); const Command = require("../Structures/Command.js"); module.exports = new Command({ - name: cmdconfig.InfoCommand, - description: cmdconfig.InfoCommandDesc, + name: cmdconfig.Info.Command, + description: cmdconfig.Info.Description, options: [], - permissions: ["SEND_MESSAGES"], + permissions: cmdconfig.Info.Permission, async run(interaction) { - const InfoButton = new Discord.ButtonBuilder() - .setLabel(supportbot.InfoButtonText) - .setURL(supportbot.InfoURL) - .setStyle("Link"); + if (cmdconfig.Info.Enabled === false) { + if (interaction.type === Discord.InteractionType.ApplicationCommand && disableCommand) + return interaction.reply({ + content: ":x: This command is `disabled`", + ephemeral: true, + }); + } - const inforow = new Discord.ActionRowBuilder().addComponents(InfoButton); + const InfoButton = new Discord.ButtonBuilder() + .setLabel(supportbot.InfoButtonText) + .setURL(supportbot.InfoURL) + .setStyle("Link"); - const InfoEmbed = new Discord.EmbedBuilder() - .setURL(supportbot.InfoURL) - .setTitle(supportbot.InfoTitle) - .setDescription(supportbot.InfoDesc) - .setColor(supportbot.InfoColour) + const inforow = new Discord.ActionRowBuilder().addComponents(InfoButton); + + const InfoEmbed = new Discord.EmbedBuilder() + .setURL(supportbot.InfoURL) + .setTitle(supportbot.InfoTitle) + .setDescription(supportbot.InfoDesc) + .setColor(supportbot.InfoColour) + + interaction.reply({ + embeds: [InfoEmbed], + components: [inforow], + }); - interaction.reply({ - embeds: [InfoEmbed], - components: [inforow], - }); }, }); \ No newline at end of file diff --git a/Commands/ping.js b/Commands/ping.js index 4728bbe..d494df1 100644 --- a/Commands/ping.js +++ b/Commands/ping.js @@ -13,12 +13,22 @@ const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8")); const Command = require("../Structures/Command.js"); module.exports = new Command({ - name: cmdconfig.PingCommand, - description: cmdconfig.PingCommandDesc, + name: cmdconfig.Ping.Command, + description: cmdconfig.Ping.Description, options: [], - permissions: ["SEND_MESSAGES"], + permissions: cmdconfig.Ping.Permission, async run(interaction) { + let disableCommand = true; + + if (cmdconfig.Ping.Enabled === false) { + if (interaction.type === Discord.InteractionType.ApplicationCommand && disableCommand) + return interaction.reply({ + content: ":x: This command is `disabled`", + ephemeral: true, + }); + } + const PingEmbed = new Discord.EmbedBuilder() .setDescription( `:ping_pong: **Ping:** \`${interaction.client.ws.ping} ms\`` diff --git a/Commands/remove.js b/Commands/remove.js index a902c0c..bf93211 100644 --- a/Commands/remove.js +++ b/Commands/remove.js @@ -13,8 +13,8 @@ const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8")); const Command = require("../Structures/Command.js"); module.exports = new Command({ - name: cmdconfig.TicketRemove, - description: cmdconfig.TicketRemoveDesc, + name: cmdconfig.TicketRemove.Command, + description: cmdconfig.TicketRemove.Description, type: Discord.ApplicationCommandType.ChatInput, options: [ { @@ -25,9 +25,19 @@ module.exports = new Command({ required: true, }, ], - permissions: ["SEND_MESSAGES"], + permissions: cmdconfig.TicketRemove.Permission, async run(interaction) { + let disableCommand = true; + + if (cmdconfig.TicketRemove.Enabled === false) { + if (interaction.type === Discord.InteractionType.ApplicationCommand && disableCommand) + return interaction.reply({ + content: ":x: This command is `disabled`", + ephemeral: true, + }); + } + const { getRole } = interaction.client; let Staff = await getRole(supportbot.Staff, interaction.guild); let Admin = await getRole(supportbot.Admin, interaction.guild); diff --git a/Commands/suggest.js b/Commands/suggest.js index 54ef212..03b25de 100644 --- a/Commands/suggest.js +++ b/Commands/suggest.js @@ -13,8 +13,8 @@ const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8")); const Command = require("../Structures/Command.js"); module.exports = new Command({ - name: cmdconfig.SuggestCommand, - description: cmdconfig.SuggestCommandDesc, + name: cmdconfig.Suggestion.Command, + description: cmdconfig.Suggestion.Description, type: Discord.ApplicationCommandType.ChatInput, options: [ { @@ -25,9 +25,19 @@ module.exports = new Command({ required: true, }, ], - permissions: ["SEND_MESSAGES"], + permissions: cmdconfig.Suggestion.Permission, async run(interaction) { + let disableCommand = true; + + if (cmdconfig.Suggestion.Enabled === false) { + if (interaction.type === Discord.InteractionType.ApplicationCommand && disableCommand) + return interaction.reply({ + content: ":x: This command is `disabled`", + ephemeral: true, + }); + } + const { getChannel } = interaction.client; const suggestChannel = await getChannel( supportbot.SuggestionChannel, diff --git a/Commands/ticket.js b/Commands/ticket.js index c9a7be8..d08e4b8 100644 --- a/Commands/ticket.js +++ b/Commands/ticket.js @@ -4,13 +4,14 @@ const fs = require("fs"); const { - MessageEmbed, + EmbedBuilder, Permissions, MessageButton, MessageActionRow, ApplicationCommandOptionType, ApplicationCommandType, - ButtonStyle + ButtonStyle, + InteractionType } = require("discord.js"); const yaml = require("js-yaml"); @@ -23,8 +24,8 @@ const Command = require("../Structures/Command.js"); const TicketNumberID = require("../Structures/TicketID.js"); module.exports = new Command({ - name: cmdconfig.OpenTicket, - description: cmdconfig.OpenTicketDesc, + name: cmdconfig.OpenTicket.Command, + description: cmdconfig.OpenTicket.Description, type: ApplicationCommandType.ChatInput, options: [ { @@ -34,15 +35,19 @@ module.exports = new Command({ }, ], - permissions: ["SEND_MESSAGES"], + permissions: cmdconfig.OpenTicket.Permission, async run(interaction) { let disableCommand = true; - if (interaction.isCommand() && disableCommand) + + if (cmdconfig.OpenTicket.Enabled === false) { + if (interaction.type === InteractionType.ApplicationCommand && disableCommand) return interaction.reply({ - content: "This command is disabled", + content: ":x: This command is `disabled`", ephemeral: true, }); + } + let department = interaction.customId?.split("-")[1] || null; let TicketData = await JSON.parse( fs.readFileSync("./Data/TicketData.json", "utf8") @@ -86,7 +91,7 @@ module.exports = new Command({ const TicketSubject = interaction.options?.getString("reason") || supportbot.NoTicketSubject; - const TicketExists = new MessageEmbed() + const TicketExists = new EmbedBuilder() .setTitle("Ticket Exists!") .setDescription(supportbot.TicketExists); @@ -161,7 +166,7 @@ module.exports = new Command({ } ); - const CreatedTicket = new MessageEmbed() + const CreatedTicket = new EmbedBuilder() .setDescription( supportbot.TicketCreatedAlert.replace( /%ticketauthor%/g, @@ -177,7 +182,7 @@ module.exports = new Command({ await ticketChannel.send(`${interaction.user}`); } - const TicketMessage = new MessageEmbed() + const TicketMessage = new EmbedBuilder() .setTitle( supportbot.Ticket_Title.replace(/%ticketauthor%/g, interaction.user.id) .replace(/%ticketid%/g, ticketChannel.id) diff --git a/Commands/translate.js b/Commands/translate.js index 29d128e..9ca45b1 100644 --- a/Commands/translate.js +++ b/Commands/translate.js @@ -16,8 +16,8 @@ const Command = require("../Structures/Command.js"); const translate = require("@vitalets/google-translate-api"); module.exports = new Command({ - name: cmdconfig.TranslateCommand, // Name of command - description: cmdconfig.TranslateCommandDesc, // Description of command + name: cmdconfig.Translate.Command, + description: cmdconfig.Translate.Description, type: Discord.ApplicationCommandType.ChatInput, options: [ { @@ -33,9 +33,18 @@ module.exports = new Command({ required: true, }, // The input text for the translation ], - permissions: ["SEND_MESSAGES"], // The permission the user/role at least requires + permissions: cmdconfig.Translate.Permission, // The permission the user/role at least requires async run(interaction) { + let disableCommand = true; + + if (cmdconfig.Translate.Enabled === false) { + if (interaction.type === Discord.InteractionType.ApplicationCommand && disableCommand) + return interaction.reply({ + content: ":x: This command is `disabled`", + ephemeral: true, + }); + } const { getRole } = interaction.client; let SupportStaff = await getRole(supportbot.Staff, interaction.guild); diff --git a/Commands/userinfo.js b/Commands/userinfo.js index ee68fc3..12ce526 100644 --- a/Commands/userinfo.js +++ b/Commands/userinfo.js @@ -16,8 +16,8 @@ const cmdconfig = yaml.load( const Command = require("../Structures/Command.js"); module.exports = new Command({ - name: cmdconfig.UserInfoCommand, // Name of command - description: cmdconfig.UserInfoCommandDesc, // Description of command + name: cmdconfig.UserInfo.Command, + description: cmdconfig.UserInfo.Description, type: Discord.ApplicationCommandType.ChatInput, options: [ { @@ -27,9 +27,19 @@ module.exports = new Command({ required: true, }, // The user input ], - permissions: ["SEND_MESSAGES"], // The permission the user/role at least requires + permissions: cmdconfig.UserInfo.Permission, async run(interaction) { + let disableCommand = true; + + if (cmdconfig.UserInfo.Enabled === false) { + if (interaction.type === Discord.InteractionType.ApplicationCommand && disableCommand) + return interaction.reply({ + content: ":x: This command is `disabled`", + ephemeral: true, + }); + } + const { getRole } = interaction.client; let SupportStaff = await getRole(supportbot.Staff, interaction.guild); let Admin = await getRole(supportbot.Admin, interaction.guild); diff --git a/Configs/commands.yml b/Configs/commands.yml index 2196b67..6e71ad4 100644 --- a/Configs/commands.yml +++ b/Configs/commands.yml @@ -7,25 +7,76 @@ # SupportBot created by Emerald Services # Installed with MIT License # -# Discord Support: https://emeraldsrv.dev/discord -# Community Resources: https://emeraldsrv.dev/resources +# Discord Support: https://dsc.gg/emerald-dev +# Official Documentation: https://emeraldsrv.dev/wiki +# Third-Party Documentation: https://emeraldsrv.dev/third-party +# +# Command Configuration -# ------------------------------- -# Command Name Configuration -# ------------------------------- +Help: + Command: "help" + Description: "Get a list of all the commands." + Permission: ["SEND_MESSAGES"] + Enabled: true -Blacklist: "blacklist" -TicketAdd: "add" -TicketRemove: "remove" -OpenTicket: "ticket" -CloseTicket: "close" -InfoCommand: "info" -PingCommand: "ping" -HelpCommand: "help" -EmbedCommand: "embed" -SuggestCommand: "suggest" -TranslateCommand: "translate" -UserInfoCommand: "userinfo" +Info: + Command: "info" + Description: "Get information about the **ServerName**." + Permission: ["SEND_MESSAGES"] + Enabled: true + +TicketAdd: + Command: "add" + Description: "Add a user to a ticket." + Permission: ["SEND_MESSAGES"] + Enabled: false + +TicketRemove: + Command: "remove" + Description: "Remove a user from a ticket." + Permission: ["SEND_MESSAGES"] + Enabled: true + +OpenTicket: + Command: "ticket" + Description: "Create a support ticket." + Permission: ["SEND_MESSAGES"] + Enabled: true + +CloseTicket: + Command: "close" + Description: "Close a support ticket" + Permission: ["SEND_MESSAGES"] + +Suggestion: + Command: "suggest" + Description: "Create a suggestion." + Permission: ["SEND_MESSAGES"] + Enabled: true + +Embed: + Command: "embed" + Description: "Build a discord embed." + Permission: ["SEND_MESSAGES"] + Enabled: true + +Translate: + Command: "translate" + Description: "Translate something to english" + Permission: ["SEND_MESSAGES"] + Enabled: true + +UserInfo: + Command: "userinfo" + Description: "Get info about a user." + Permission: ["SEND_MESSAGES"] + Enabled: true + +Ping: + Command: "ping" + Description: "Pong." + Permission: ["SEND_MESSAGES"] + Enabled: true # --------------------------------------- # Command Description Configuration diff --git a/Configs/supportbot.yml b/Configs/supportbot.yml index 7161edc..605f2c6 100644 --- a/Configs/supportbot.yml +++ b/Configs/supportbot.yml @@ -11,7 +11,7 @@ # Official Documentation: https://emeraldsrv.dev/wiki # Third-Party Documentation: https://emeraldsrv.dev/third-party -SupportBot_Version: "v8.0 DEV-v1.0" +SupportBot_Version: "v8.0 DEV-v1.1" # ------------------------- # General Configuration @@ -19,18 +19,18 @@ SupportBot_Version: "v8.0 DEV-v1.0" General: Name: "SupportBot" - Token: "BOT_TOKEN" + Token: "" # ------------------------- # Activity Configuration # ------------------------- -Status: "SupportBot v8" -Type: "Watching" -# The Type can either be Playing, Watching, Listenin or Streaming. - -StreamingURL: "https://www.twitch.tv/YOUR_TWITCH_NAME" -# Set The Type to "Streaming" for a streaming status! +Activity: + Status: "SupportBot v8" + Type: "Watching" + # The Type can either be Playing, Watching, Listenin or Streaming. + StreamingURL: "https://www.twitch.tv/YOUR_TWITCH_NAME" + # Set The Type to "Streaming" for a streaming status! # ------------------------- # Embed Configuration @@ -260,4 +260,4 @@ IncorrectPerms: "> :x: **Err!** You do not have the correct permissions to use t InvalidChannel: "> :x: **Err!** Channel not found. Please create it!" UserNotFound: "> :x: **Err!** This user doesn't exist, Are they in this server?" NoValidTicket: "> :warning: You cannot execute this command here." -TicketExists: "> :warning: This ticket cannot be opened, It already exists!" +TicketExists: "> :warning: This ticket cannot be opened, It already exists!" \ No newline at end of file diff --git a/Data/ticket-panel-id.json b/Data/ticket-panel-id.json index 63b7e0c..46a3c59 100644 --- a/Data/ticket-panel-id.json +++ b/Data/ticket-panel-id.json @@ -1 +1,4 @@ -{"id":0,"TicketPanelID":""} \ No newline at end of file +{ + "id": 4, + "TicketPanelID": "" +} \ No newline at end of file diff --git a/Events/interactionCreate.js b/Events/interactionCreate.js index ff049ed..df46174 100644 --- a/Events/interactionCreate.js +++ b/Events/interactionCreate.js @@ -49,7 +49,7 @@ module.exports = new Event("interactionCreate", async (client, interaction) => { interaction.customId.includes("department-") ) { try { - const cmd = client.commands.get(cmdconfig.OpenTicket); + const cmd = client.commands.get(cmdconfig.OpenTicket.Command); if (!cmd) return; cmd.run(interaction); } catch (error) { @@ -59,7 +59,7 @@ module.exports = new Event("interactionCreate", async (client, interaction) => { if (interaction.customId === "ticketclose") { try { - const cmd = client.commands.get(cmdconfig.CloseTicket); + const cmd = client.commands.get(cmdconfig.CloseTicket.Command); if (!cmd) return; cmd.run(interaction); } catch (error) { diff --git a/Events/ready.js b/Events/ready.js index 2c09eb2..6ee0355 100644 --- a/Events/ready.js +++ b/Events/ready.js @@ -16,9 +16,9 @@ const Event = require("../Structures/Event.js"); module.exports = new Event("ready", async (client, interaction) => { const { getRole, getChannel, getCategory } = client; - client.user.setActivity(supportbot.Activity, { - type: supportbot.Type, - url: supportbot.StreamingURL, + client.user.setActivity(supportbot.Activity.Status, { + type: supportbot.Activity.Type, + url: supportbot.Activity.StreamingURL, }); console.log(`\u001b[32m`, `――――――――――――――――――――――――――――――――――――――――――――`); @@ -90,8 +90,8 @@ module.exports = new Event("ready", async (client, interaction) => { const roles = [ supportbot.Admin, supportbot.Staff, - supportbot?.TicketBlackListRole, - supportbot?.TicketMutedRole + supportbot.TicketBlackListRole, + supportbot.TicketMutedRole ]; supportbot.Departments.forEach((department) => roles.push(department.role)); @@ -111,6 +111,7 @@ module.exports = new Event("ready", async (client, interaction) => { const missingC = []; const missingR = []; const missingCat = []; + for (let c of channels) { if ((c === supportbot.SuggestionChannel && supportbot.DisableSuggestionsChannel) || c === supportbot.TicketLog && supportbot.DisableTicketLogChannel) { continue;