diff --git a/addons/addon-example.js b/addons/addon-example.js new file mode 100644 index 0000000..76ec67b --- /dev/null +++ b/addons/addon-example.js @@ -0,0 +1,19 @@ +// SupportBot 6.0, Created by Emerald Services +// Help Command + +const Discord = require("discord.js"); +const fs = require("fs"); + +const yaml = require('js-yaml'); + +// location for the addons configuration, to keep it simple we generate a settings folder within the addons directory. +const example = yaml.load(fs.readFileSync('./addons/settings/exampleaddon.yml', 'utf8')); + +module.exports = { + name: example.ExampleAddonCommand, + description: example.ExampleAddonDesc, + + execute(message, args) { + message.channel.send(example.ExampleAddonMessage) + } +}; \ No newline at end of file diff --git a/addons/settings/exampleaddon.yml b/addons/settings/exampleaddon.yml new file mode 100644 index 0000000..91876a0 --- /dev/null +++ b/addons/settings/exampleaddon.yml @@ -0,0 +1,9 @@ +# +# SupportBot 6.0 +# Example Addon +# + +ExampleAddonCommand: "exampleaddon" +ExampleAddonDesc: "This is the default/example addon for SupportBot." + +ExampleAddonMessage: "> :white_check_mark: This is the **default** addon for SupportBot. You can download addons from our website, https://emeraldservices.xyz/" \ No newline at end of file diff --git a/commands/addUser.js b/commands/addUser.js index 9a345de..d30ca34 100644 --- a/commands/addUser.js +++ b/commands/addUser.js @@ -22,7 +22,7 @@ module.exports = { .setDescription(`${supportbot.IncorrectPerms}\n\nRole Required: \`${supportbot.Staff}\` or \`${supportbot.Admin}\``) .setColor(supportbot.WarningColour) - if (!message.member.roles.cache.has(SupportStaff.id || Admins.id)) { + if (message.member.roles.cache.has(SupportStaff.id) || message.member.roles.cache.has(Admins.id)) { if (!message.channel.name.startsWith( `${supportbot.TicketChannel}-` )) { const Exists = new Discord.MessageEmbed() .setTitle("No Ticket Found!") @@ -61,4 +61,4 @@ module.exports = { } } -}; +}; \ No newline at end of file diff --git a/commands/helptest.js b/commands/helptest.js deleted file mode 100644 index aa46695..0000000 --- a/commands/helptest.js +++ /dev/null @@ -1,33 +0,0 @@ -// SupportBot 6.0, Created by Emerald Services -// Links Command - -const Discord = require("discord.js"); -const fs = require("fs"); - -const yaml = require('js-yaml'); -const { execute } = require("./help"); -const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8')); - -module.exports = { - name: supportbot.LinksCommand, - description: supportbot.LinksDesc, - - execute(message, args) { - - const LinksEmbed = new Discord.MessageEmbed() - .setColor(supportbot.EmbedColour) - - let botLinks = supportbot.HELP; - - let links = ''; - - for ( let name in botLinks ) { - links += `[${name}](${botLinks[ name ]})\n`; - }; - - LinksEmbed.addField(supportbot.HelpTitle, links) - - message.channel.send({ embed: LinksEmbed }); - - } -}; \ No newline at end of file diff --git a/commands/removeUser.js b/commands/removeUser.js index 4d260d9..34cb52f 100644 --- a/commands/removeUser.js +++ b/commands/removeUser.js @@ -22,7 +22,7 @@ module.exports = { .setDescription(`${supportbot.IncorrectPerms}\n\nRole Required: \`${supportbot.Staff}\` or \`${supportbot.Admin}\``) .setColor(supportbot.WarningColour) - if (!message.member.roles.cache.has(SupportStaff.id || Admins.id)) { + if (message.member.roles.cache.has(SupportStaff.id) || message.member.roles.cache.has(Admins.id)) { if (!message.channel.name.startsWith( `${supportbot.TicketChannel}-` )) { const Exists = new Discord.MessageEmbed() .setTitle("No Ticket Found!") @@ -59,4 +59,4 @@ module.exports = { } } -}; +}; \ No newline at end of file diff --git a/index.js b/index.js index 674321e..eb0483f 100644 --- a/index.js +++ b/index.js @@ -78,7 +78,7 @@ fs.readdir("./addons/", (err, files) => { } jsfiles.forEach((f, i) => { - let props = require(`./commands/${f}`); + let props = require(`./addons/${f}`); console.info(`\u001b[37m`, `[${supportbot.Bot_Name}]:`, `\u001b[31m`, `#${i + 1} Command Loaded: ${props.name.toProperCase()}`); bot.commands.set(props.name, props); }); diff --git a/storage/SupportTickets.json b/storage/SupportTickets.json index 63b9e40..72a7bfd 100644 --- a/storage/SupportTickets.json +++ b/storage/SupportTickets.json @@ -1,4 +1,4 @@ { - "ticket": "ticket-0062", - "id":419821884431925260 + "ticket": "ticket-0064", + "id":207937608779694080 } \ No newline at end of file diff --git a/storage/TicketID.json b/storage/TicketID.json index 6a8227a..052c513 100644 --- a/storage/TicketID.json +++ b/storage/TicketID.json @@ -1,5 +1,5 @@ { "716992597377286145": { - "id": 63 + "id": 65 } } \ No newline at end of file diff --git a/supportbot-config.yml b/supportbot-config.yml index 239e0c9..91d324a 100644 --- a/supportbot-config.yml +++ b/supportbot-config.yml @@ -11,15 +11,13 @@ # General Bot Configuration -Token: "NjcyMTU5MjQyNjg5NzA4MDUz.XwnBpg.6eCCVRv4m-aVPJuppHWNxpxpRs0" -Prefix: "!!" -Bot_Name: "SupportBot DEV" +Token: "BOT_TOKEN_HERE" +Prefix: "-" +Bot_Name: "SupportBot" -BotActivity: "SB-6.0 dev-0.1" +BotActivity: "!help ~ SupportBot 6.0" ActivityType: "PLAYING" - -ShowErrorCodes: "true" -# This feature will show supportbot error codes such as "SB-01" +# Activity status can either be PLAYING, WATCHING or LISTENING. # Embed Configuration @@ -98,9 +96,11 @@ SystemMessage_Icon: "USER" Welcome_Title: "User Joined!" WelcomeMessage: "Hello %member%, Welcome to %guildname%!" +# %member% define the user who joined and %guildnamne% defines the server name. Leave_Title: "User Left!" LeaveMessage: "Goodbye %member%, Thank you for visting %guildname%!" +# %member% define the user who left and %guildnamne% defines the server name. SystemMessage_EmbedFooter: "false"