- Installing the Module
- ChatTriggers Import Method [Recommneded]
- Manual Method
- Creating a Discord Bot
- Intents [IMPORTANT]
- Example Usage
- Help
Before you can use this module, you need to install the ChatTriggers mod and place it in your Minecraft mods folder. Here's how to do it:
- Download the ChatTriggers mod from the official website.
- Place the downloaded
.jar
file in your Minecraft mods folder. - Launch Minecraft and join a world or server.
- Run the command
/ct import discord
in the chat to import the module.
- Download the latest release of the module from the repository
- Extract the downloaded file.
- Run the command
/ct files
- Open the modules folder
- Place the extracted files in the folder
- Run the command
/ct reload
- Go to the Discord Developer Portal and click on "New Application".
- Give your application a name and click "Create".
- Click on the "Bot" tab on the left side of the screen and then click "Add Bot".
- Under the "Token" section, click "Copy" to copy your bot's token. This token is used to log in to your bot.
- In the Discord Developer Portal, click on your application.
- Click on the "Bot" tab on the left side of the screen.
- Under the "Privileged Gateway Intents" section, toggle on "SERVER MEMBERS INTENT" and "MESSAGE CONTENT INTENT".
Bitwise intents represent the events your bot can listen to. You can calculate the bitwise value of your intents using the Discord Intents Calculator.
You can use the bitwise intents value when creating a new instance of the Client
class. Here's an example:
const client = new Client({
token: 'your-bot-token',
intents: 1512 // replace with your bitwise intents value
});
To log in to your bot, call the login
method on the Client
instance:
client.login().then(() => {
console.log('Bot is now connected!');
}).catch(console.error);
Remember to replace 'your-bot-token'
with your bot's actual token.
import DiscordClient from "../discord";
const client = new DiscordClient({
intents: 3276799
});
client.on("ready", (user) => {
console.log(`Logged in as ${user.username}!`);
});
client.on("message", (message) => {
if (message.content === '!ping') {
message.reply("pong");
}
});
client.login("token");
If you are experiencing any problems or you just can't get started with the module, don't hesitate to dm me on discord: sirence11