From 2d25bb71677f3ae2d8e4dbc18ed795d46e74e31f Mon Sep 17 00:00:00 2001 From: Braeden Sowinski Date: Fri, 29 Jul 2022 16:20:32 -0700 Subject: [PATCH] work-roles command --- commands/work-roles.js | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 commands/work-roles.js diff --git a/commands/work-roles.js b/commands/work-roles.js new file mode 100644 index 0000000..1300159 --- /dev/null +++ b/commands/work-roles.js @@ -0,0 +1,41 @@ +const { MessageEmbed } = require('discord.js'); + +module.exports = { + name: "work-roles", + debug: false, + description: "list work roles", + usage: "", + permissions: { + channel: ["VIEW_CHANNEL", "SEND_MESSAGES", "EMBED_LINKS"], + member: [], + }, + SlashCommand: { + options: [], + /** + * + * @param {require("../structures/QuarksBot")} client + * @param {import("discord.js").MessageCreate} message + * @param {string[]} args + * @param {*} param3 + */ + run: async (client, interaction, args, { GuildDB }) => { + if (GuildDB.customChannelStatus==true&&!GuildDB.allowedChannels.includes(interaction.channel_id)) { + return interaction.send(`You are not allowed to use the bot in this channel.`); + } + + let listEmbed = new MessageEmbed() + .setColor(client.config.EmbedColor) + .setTitle('List of Work Roles') + + let data = `` + + for (let i = 0; i < GuildDB.incomeRoles.length; i++) { + data += `<@&${GuildDB.incomeRoles[i].role}> - $${GuildDB.incomeRoles[i].income} per day\n` + } + + listEmbed.setDescription(data) + + return interaction.send({ embeds: [listEmbed] }) + }, + }, +} \ No newline at end of file