mirror of
https://github.com/arthur-pbty/gestion.git
synced 2026-06-03 23:36:35 +02:00
26 lines
583 B
JavaScript
26 lines
583 B
JavaScript
require('dotenv').config();
|
|
const { Client, GatewayIntentBits } = require('discord.js');
|
|
|
|
const client = new Client({
|
|
intents: [
|
|
GatewayIntentBits.Guilds,
|
|
GatewayIntentBits.GuildMessages,
|
|
GatewayIntentBits.MessageContent,
|
|
GatewayIntentBits.GuildMembers,
|
|
],
|
|
});
|
|
|
|
|
|
client.on('ready', () => {
|
|
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!');
|
|
}
|
|
});
|
|
|
|
client.login(process.env.TOKEN); |