Files
gestion/commands/utils/channel.js
T
2024-02-16 23:47:07 +01:00

25 lines
1.1 KiB
JavaScript

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] });
},
};