D
D
Daniel_Cap2022-01-14 20:12:34
Node.js
Daniel_Cap, 2022-01-14 20:12:34

Discord js - Bot not responding to messages, what could I have done wrong?

The bot does not respond to messages in any way.

Nothing in the console except Logged in as "bot name" The

bot is on a vps with Ubuntu 20.04 64bit

Node version 16.13.2

At the same time, the bot is online

Code:

const { Client, Intents } = require('discord.js');
const client = new Client({ intents: [Intents.FLAGS.GUILDS] });

client.on('ready', () => {
  console.log(`Logged in as ${client.user.tag}!`);
});

client.on('interactionCreate', async interaction => {
  if (!interaction.isCommand()) return;

  if (interaction.commandName === 'ping') {
    await interaction.reply('Pong!');
  }
});

client.login('тут мой токен(с ним проблем нет)');

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2022-01-14
@Daniel_Cap

const client = new Client({ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MEMBERS, Intents.FLAGS.GUILD_MESSAGES] });

Intents Class
Intents Guide

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question