Files
gestion/commands/utils/channel.js
T
2024-02-17 13:33:46 +01:00

30 lines
1.2 KiB
JavaScript

const { EmbedBuilder } = require('discord.js');
module.exports = {
name: 'channel',
aliases: ['salon', 'channelinfo', 'saloninfo'],
description: 'Affiche les informations sur un salon',
category: 'utils',
emote: '📌',
utilisation: 'channel <#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] });
},
};