mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-04 06:28:53 +00:00
Added /guilds system command
This commit is contained in:
1 parent
e80a28d975
commit
8ea07b4997
1 file changed
+38
@@ -0,0 +1,38 @@
|
|||||||
|
const { SlashCommandBuilder } = require('@discordjs/builders');
|
||||||
|
const { EmbedBuilder } = require('discord.js');
|
||||||
|
const {
|
||||||
|
embedColors,
|
||||||
|
systemServerGuildId,
|
||||||
|
botOwnerClientId
|
||||||
|
} = require('../config.json');
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
data: new SlashCommandBuilder()
|
||||||
|
.setName('guilds')
|
||||||
|
.setDescription('Show list of guilds where bot is added.'),
|
||||||
|
run: async ({ interaction, client }) => {
|
||||||
|
if (
|
||||||
|
interaction.guildId !== systemServerGuildId ||
|
||||||
|
interaction.user.id !== botOwnerClientId
|
||||||
|
) {
|
||||||
|
return await interaction.editReply({
|
||||||
|
embeds: [
|
||||||
|
new EmbedBuilder()
|
||||||
|
.setDescription(
|
||||||
|
`**No permission**\nYou do not have permission to use this command.`
|
||||||
|
)
|
||||||
|
.setColor(embedColors.colorError)
|
||||||
|
]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
let guildsList = client.guilds.cache.map((guild) => guild.name).join(', ');
|
||||||
|
|
||||||
|
return await interaction.editReply({
|
||||||
|
embeds: [
|
||||||
|
new EmbedBuilder()
|
||||||
|
.setDescription(`**Guilds**\n${guildsList}`)
|
||||||
|
.setColor(embedColors.colorInfo)
|
||||||
|
]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
Reference in new issue
Block a user