13.2.3 add channels command
This commit is contained in:
2 files changed
+52
-1
No files matched your search
@@ -0,0 +1,51 @@
|
||||
const { EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle } = require('discord.js');
|
||||
|
||||
module.exports = {
|
||||
name: "channels",
|
||||
debug: false,
|
||||
global: false,
|
||||
description: "view the list of allowed channels",
|
||||
usage: "",
|
||||
permissions: {
|
||||
channel: ["VIEW_CHANNEL", "SEND_MESSAGES", "EMBED_LINKS"],
|
||||
member: [],
|
||||
},
|
||||
options: [],
|
||||
SlashCommand: {
|
||||
/**
|
||||
* @param {require("../structures/QuarksBot")} client
|
||||
* @param {import("discord.js").Message} 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({ content: `You are not allowed to use the bot in this channel.` });
|
||||
}
|
||||
|
||||
if (GuildDB.allowedChannels.length == 0) {
|
||||
const embed = new EmbedBuilder()
|
||||
.setColor(client.config.Colors.Default)
|
||||
.setDescription('There are no configured channels for this bot, you can use it anywhere!');
|
||||
|
||||
return interaction.send({ embeds: [embed] });
|
||||
}
|
||||
|
||||
let channels = new EmbedBuilder()
|
||||
.setColor(client.config.Colors.Default)
|
||||
.setTitle('Configured Channels')
|
||||
|
||||
let des = "";
|
||||
|
||||
for (let i = 0; i < GuildDB.allowedChannels.length; i++) {
|
||||
if (i == 0) des += `> <#${GuildDB.allowedChannels[i]}>`;
|
||||
else des += `\n> <#${GuildDB.allowedChannels[i]}>`
|
||||
}
|
||||
|
||||
channels.setDescription(des);
|
||||
|
||||
return interaction.send({ embeds: [channels] });
|
||||
},
|
||||
},
|
||||
Interactions: {}
|
||||
}
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "quarksbot",
|
||||
"version": "13.2.3",
|
||||
"version": "13.2.4",
|
||||
"description": "Grand Theft Auto V Roleplay Bot",
|
||||
"main": "index.js",
|
||||
"nodemonConfig": {
|
||||
|
||||
Reference in new issue
Block a user