Files
SupportBot/Commands/info.js
T

49 lines
1.3 KiB
JavaScript
Raw Normal View History

2021-10-04 20:41:05 +01:00
// SupportBot | Emerald Services
// Info Command
const fs = require("fs");
const Discord = require("discord.js");
2021-10-24 22:41:46 +01:00
const yaml = require("js-yaml");
2021-10-27 19:30:10 -05:00
const supportbot = yaml.load(
fs.readFileSync("./Configs/supportbot.yml", "utf8")
);
const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8"));
2021-10-04 20:41:05 +01:00
const Command = require("../Structures/Command.js");
module.exports = new Command({
2022-07-23 07:50:12 +01:00
name: cmdconfig.Info.Command,
description: cmdconfig.Info.Description,
options: [],
2022-07-23 07:50:12 +01:00
permissions: cmdconfig.Info.Permission,
2021-10-24 22:41:46 +01:00
async run(interaction) {
2022-07-23 07:50:12 +01:00
if (cmdconfig.Info.Enabled === false) {
if (interaction.type === Discord.InteractionType.ApplicationCommand && disableCommand)
return interaction.reply({
content: ":x: This command is `disabled`",
ephemeral: true,
});
}
const InfoButton = new Discord.ButtonBuilder()
.setLabel(supportbot.InfoButtonText)
.setURL(supportbot.InfoURL)
.setStyle("Link");
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],
});
2021-10-24 22:41:46 +01:00
},
2022-07-22 13:19:05 +01:00
});