mirror of
https://github.com/arthur-pbty/gestion.git
synced 2026-06-03 23:36:35 +02:00
25 lines
1.1 KiB
JavaScript
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] });
|
|
},
|
|
}; |