mirror of
https://github.com/arthur-pbty/gestion.git
synced 2026-06-12 23:59:20 +02:00
intents
This commit is contained in:
@@ -1,15 +1,25 @@
|
|||||||
const Discord = require('discord.js');
|
|
||||||
require('dotenv').config();
|
require('dotenv').config();
|
||||||
|
const { Client, GatewayIntentBits } = require('discord.js');
|
||||||
|
|
||||||
const client = new Discord.Client();
|
const client = new Client({
|
||||||
|
intents: [
|
||||||
client.on('ready', () => {
|
GatewayIntentBits.Guilds,
|
||||||
console.log(`Bot is ready as: ${client.user.tag}`);
|
GatewayIntentBits.GuildMessages,
|
||||||
|
GatewayIntentBits.MessageContent,
|
||||||
|
GatewayIntentBits.GuildMembers,
|
||||||
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
client.on('message', message => {
|
|
||||||
if (message.content === 'ping') {
|
client.on('ready', () => {
|
||||||
message.reply('pong');
|
console.log(`Logged in as ${client.user.tag}!`);
|
||||||
|
});
|
||||||
|
|
||||||
|
client.on('interactionCreate', async interaction => {
|
||||||
|
if (!interaction.isChatInputCommand()) return;
|
||||||
|
|
||||||
|
if (interaction.commandName === 'ping') {
|
||||||
|
await interaction.reply('Pong!');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user