/BusesDevonMarijuana
Created 1 year, 4 months ago...
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
client.on('interactionCreate', (interaction) => {
if (!interaction.isCommand()) {
return;
}
const commandName = interaction.commandName;
const user = interaction.user.tag;
const guild = interaction.guild.name;
const optionsData = interaction.options.data ? Array.from(interaction.options.data) : [];
const timestamp = moment().tz('Europe/Moscow').format('DD.MM.YYYY HH:mm');
const contentArray = interaction.options.data.map((option) => {
if (option.value) {
return `${option.name}: ${option.value}`;
} else {
return `${option.name}: None`;
}
});
console.log(
chalk.red(chalk.bold(`[${timestamp}]`)),
chalk.blue(chalk.bold(`[CMD]`)),
chalk.green(`Command:`),
chalk.red(`${commandName}`),
contentArray.length > 0 ? chalk.red(`Content: ${contentArray.join(' | ')}`) : chalk.green(`Content: None`),
chalk.green(`| User:`),
chalk.blue(`${user}`),
chalk.green(`| Server:`),
chalk.blue(`${guild}`)
)});