Introduction
This section will cover the event handling part, which is a fundamental concept of a Discord bot.
Project Structure
To efficiently handle events in our Discord bot, we'll structure our project in a way that separates different responsibilities. Below is an example project structure focusing on event handling:
Type of events
Discord has various types of events; however, the main three events required to run an app are:
ready
eventmessageCreate
eventinteractionCreate
event
You can learn about more events from discord.js events (opens in a new tab).
Now let's understand these events one by one! So, let's go!