mirror of
https://github.com/arthur-pbty/gestion.git
synced 2026-06-20 13:50:39 +02:00
add util commande
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
const { EmbedBuilder } = require('discord.js');
|
||||
|
||||
module.exports = {
|
||||
name: 'channel',
|
||||
description: 'Affiche les informations sur un salon',
|
||||
async execute(message) {
|
||||
const channel = message.mentions.channels.first() || message.channel;
|
||||
|
||||
if (!channel || !channel.viewable) {
|
||||
return message.reply('Je ne peux pas accéder à ce salon.');
|
||||
}
|
||||
const embed = new EmbedBuilder()
|
||||
.setTitle(`Informations sur le salon **${channel.name}**`)
|
||||
.addFields(
|
||||
{ name: '**Nom**', value: `<#${channel.id}>`, inline: true },
|
||||
{ name: '**ID**', value: channel.id, inline: true },
|
||||
{ name: '**NSFW**', value: channel.nsfw ? '✅' : '❌', inline: true },
|
||||
{ name: '**Mode Lent**', value: channel.rateLimitPerUser ? `${channel.rateLimitPerUser} secondes` : '❌', inline: true },
|
||||
{ name: '**Créé le**', value: `<t:${Math.floor(channel.createdTimestamp / 1000)}:F>`, inline: true }
|
||||
)
|
||||
.setColor('#0099ff');
|
||||
|
||||
message.channel.send({ embeds: [embed] });
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user