Discord.js Essentials
To build bot with dixt, it helps to be familiar with discord.js features such as client or slash commands. This page will give you a brief overview of these features.
If you"re new to discord.js, we also recommend reffering to the discord.js Documentation (opens in a new tab). Here are some great resources for learning:
- discord.js Guide (opens in a new tab)
- discord.js Rapid Tutorial (opens in a new tab)
- discord.js freeCodeCamp Tutorial (opens in a new tab)
Client
The client is the main interface for interacting with the Discord API, and the starting point for any bot. It is the main class in discord.js.
const { Client } = require("discord.js");
const client = new Client();
client.on("ready", () => {
console.log(`Logged in as ${client.user.tag}!`);
});
client.login("your_bot_token");