Migration Guide
Learn how to upgrade your meowcord bot to the latest version.
Upgrading to v0.1.3
Version 0.1.3 introduces a few changes to how commands are reloaded. Here's what you need to know:
Important Change
reloadCommands()
function has been removed in v0.1.3.Command Reloading
Instead of using reloadCommands()
, you now need to use a two-step process:
Old way (v0.1.2 and earlier):
// Reload commands
bot.reloadCommands();
New way (v0.1.3):
// Step 1: Clear all existing commands
bot.clearCommands();
// Step 2: Reload commands from the folder
bot.loadCommandFromFolder(path.join(__dirname, "commands"));
Command Parameters
In v0.1.3, meowcord now automatically detects whether your command function needs the args parameter. This means you can define your command functions with either one parameter (message) or two parameters (message, args):
// Command with just message parameter
bot.basicCommand({
cmdName: "ping",
cmdCode: async (message) => {
message.reply("Pong!");
}
});
// Command with message and args parameters
bot.basicCommand({
cmdName: "say",
cmdCode: async (message, args) => {
if (!args.length) return message.reply("Please provide something for me to say!");
message.reply(args.join(" "));
}
});
Upgrading to v0.1.2
Version 0.1.2 was a major update that introduced significant architectural improvements and new features:
Command Handling Architecture
The biggest change in v0.1.2 is the command handling architecture. All commands now use a single messageCreate event listener instead of creating separate listeners for each command. This fixes the EventEmitter maximum listener warning and improves performance.
No code changes are required to benefit from this improvement.
New Presence Management Functions
Version 0.1.2 adds new functions for managing your bot's presence:
// Set activity to "Playing meowcord"
bot.discordClient.user.setActivity("meowcord", { type: "PLAYING" });
// Set status to idle (yellow)
bot.discordClient.user.setStatus("idle");
Disabling Logs
You can now disable console logs by setting the disableLogs
option in meowSettings:
const bot = new Meow({
intents: [Intents.Guilds, Intents.GuildMessages, Intents.MessageContent],
prefix: "!",
meowSettings: {
disableLogs: true // Disable console logs
},
});
Removed Features
The following features were removed in v0.1.2:
- Meowsic functionality
- Some chalk coloring for better compatibility
If your bot was using these features, you'll need to remove those parts of your code or find alternative solutions.
Upgrading to v0.1.1
Version 0.1.1 added command listing functionality and the ability to reload commands:
// Get a list of all commands
const commands = bot.commands;
console.log(commands);
// Remove a specific command
bot.removeCommand("ping");
// Clear all commands
bot.clearCommands();
These features are available without any changes to your existing code.