discord-js-bot | 🤖 Multipurpose discord bot built using discord.js v14 | Bot library
kandi X-RAY | discord-js-bot Summary
kandi X-RAY | discord-js-bot Summary
An awesome multipurpose discord bot build using discord.js v13 with support for slash commands and context menus.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of discord-js-bot
discord-js-bot Key Features
discord-js-bot Examples and Code Snippets
Community Discussions
Trending Discussions on discord-js-bot
QUESTION
I'm fairly new when it comes to creating bots for Discord, and I wanted to add a feature for it to respond to pings. I'm using this command and event handler. After a few minutes of searching, I found a way to do it about here. I put it in the message.js file (this is the file created when making the event handler), seemingly everything works, but when I use a command, the number of ping response messages increases, that is:
- if immediately after starting the bot, I ping it, it will not respond
- if I use one command and ping him, he will answer once
- if I use two commands and ping him, he will answer twice
And so on
My question is: How to make bot always answer once?
This is my code:
...ANSWER
Answered 2021-Aug-23 at 19:26By following the tutorial I was able to replicate the same command handler done in the video, and have come up with a soultuon for you.
What you basically did was put a message event, which looks for messages, inside a message handler which was added during the tutorial. Instead what I have done for you is implement the code which looks for commands in the pings handler itself
Put this code in your message.js file, inside the events/guild folder from the tutorial
QUESTION
ANSWER
Answered 2020-Feb-25 at 17:45Place the acceptable commands into an array.
e.g:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install discord-js-bot
Open the terminal and run the following commands
Wait for all the dependencies to be installed
Rename .env.example to .env and fill the values
Optionally edit config.js
Type npm run start to start the bot
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page