Advertisement
DjKammo

Untitled

Jan 25th, 2022
965
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. require('dotenv').config();
  2. const { Client, Intents } = require('discord.js');
  3.  
  4. const client = new Client({
  5.     intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES, Intents.FLAGS.GUILD_MESSAGE_REACTIONS],
  6. });
  7.  
  8. client.once('ready', () => {
  9.     console.log('Ready!');
  10. });
  11.  
  12. client.on('interactionCreate', async interaction => {
  13.     if (!interaction.isCommand()) return;
  14.  
  15.     const { commandName } = interaction;
  16.  
  17.     if (commandName === 'fruits') {
  18.         interaction.reply('Reacting with fruits!');
  19.         const message = await interaction.fetchReply();
  20.         message.react('🍎');
  21.         message.react('🍊');
  22.         message.react('🍇');
  23.     }
  24. });
  25.  
  26. client.login(process.env.TOKEN)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement