added version 2.0
This commit is contained in:
parent
0163d40b4e
commit
0f18925d1a
3231 changed files with 1449 additions and 374732 deletions
43
commands/hubs/addhub.js
Normal file
43
commands/hubs/addhub.js
Normal file
|
@ -0,0 +1,43 @@
|
|||
const {
|
||||
SlashCommandBuilder,
|
||||
EmbedBuilder,
|
||||
ButtonBuilder,
|
||||
ActionRowBuilder,
|
||||
ButtonStyle,
|
||||
PermissionsBitField,
|
||||
} = require("discord.js");
|
||||
const { errorEmbed } = require("../../libs/embeds.js");
|
||||
|
||||
module.exports = {
|
||||
data: new SlashCommandBuilder()
|
||||
.setName("addhub")
|
||||
.setDescription("Add a conversation hub to the database.")
|
||||
.setDMPermission(false),
|
||||
async execute(interaction) {
|
||||
if (
|
||||
!interaction.member.permissions.has(
|
||||
PermissionsBitField.Flags.Administrator
|
||||
)
|
||||
) {
|
||||
const embed = errorEmbed(
|
||||
"You need the administrator permission to use this command."
|
||||
);
|
||||
return interaction.reply({ embeds: [embed] });
|
||||
}
|
||||
|
||||
const embed = new EmbedBuilder()
|
||||
.setTitle("Conversation hub")
|
||||
.setDescription("Click on the button below to create a conversation.")
|
||||
.setColor("#F6C6F9")
|
||||
.setFooter({ text: "Bot by @ninja_jambon" });
|
||||
|
||||
const button = new ButtonBuilder()
|
||||
.setCustomId("create_conversation")
|
||||
.setLabel("Create conversation")
|
||||
.setStyle(ButtonStyle.Success);
|
||||
|
||||
const actionRow = new ActionRowBuilder().addComponents(button);
|
||||
|
||||
await interaction.reply({ embeds: [embed], components: [actionRow] });
|
||||
},
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue