Introduce several new slash commands including ban, kick, timeout, and userinfo. Enhance existing commands like config and rank with new features and configurations. Add new listeners for welcome and goodbye messages. Implement XP tracking for user leveling and integrate it with role rewards. Update documentation to reflect these changes. Replit-Commit-Author: Agent Replit-Commit-Session-Id: aed2e46d-25bb-4b73-81a1-bb9e8437c261 Replit-Commit-Checkpoint-Type: intermediate_checkpoint Replit-Commit-Event-Id: 1be8d824-5029-4875-bed8-0bd1d810892d Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/3bdfff67-975a-46ad-9845-fbb6b4a4c4b5/aed2e46d-25bb-4b73-81a1-bb9e8437c261/SQxsvtx Replit-Helium-Checkpoint-Created: true
53 lines
2.1 KiB
JavaScript
53 lines
2.1 KiB
JavaScript
const { SlashCommandBuilder, EmbedBuilder, ChannelType } = require('discord.js');
|
|
|
|
module.exports = {
|
|
data: new SlashCommandBuilder()
|
|
.setName('serverinfo')
|
|
.setDescription('View information about this server'),
|
|
|
|
async execute(interaction, supabase, client) {
|
|
const guild = interaction.guild;
|
|
|
|
const textChannels = guild.channels.cache.filter(c => c.type === ChannelType.GuildText).size;
|
|
const voiceChannels = guild.channels.cache.filter(c => c.type === ChannelType.GuildVoice).size;
|
|
const categories = guild.channels.cache.filter(c => c.type === ChannelType.GuildCategory).size;
|
|
|
|
const roles = guild.roles.cache.size - 1;
|
|
const emojis = guild.emojis.cache.size;
|
|
|
|
const boostLevel = guild.premiumTier;
|
|
const boostCount = guild.premiumSubscriptionCount || 0;
|
|
|
|
const owner = await guild.fetchOwner().catch(() => null);
|
|
|
|
const embed = new EmbedBuilder()
|
|
.setColor(0x7c3aed)
|
|
.setTitle(guild.name)
|
|
.setThumbnail(guild.iconURL({ size: 256 }))
|
|
.addFields(
|
|
{ name: 'ID', value: guild.id, inline: true },
|
|
{ name: 'Owner', value: owner ? owner.user.tag : 'Unknown', inline: true },
|
|
{ name: 'Created', value: `<t:${Math.floor(guild.createdTimestamp / 1000)}:R>`, inline: true },
|
|
{ name: 'Members', value: `${guild.memberCount}`, inline: true },
|
|
{ name: 'Roles', value: `${roles}`, inline: true },
|
|
{ name: 'Emojis', value: `${emojis}`, inline: true },
|
|
{ name: 'Text Channels', value: `${textChannels}`, inline: true },
|
|
{ name: 'Voice Channels', value: `${voiceChannels}`, inline: true },
|
|
{ name: 'Categories', value: `${categories}`, inline: true },
|
|
{ name: 'Boost Level', value: `Tier ${boostLevel}`, inline: true },
|
|
{ name: 'Boosts', value: `${boostCount}`, inline: true },
|
|
{ name: 'Verification', value: guild.verificationLevel.toString(), inline: true }
|
|
)
|
|
.setTimestamp();
|
|
|
|
if (guild.description) {
|
|
embed.setDescription(guild.description);
|
|
}
|
|
|
|
if (guild.bannerURL()) {
|
|
embed.setImage(guild.bannerURL({ size: 512 }));
|
|
}
|
|
|
|
await interaction.reply({ embeds: [embed] });
|
|
},
|
|
};
|