Skip to main content

Sync slash commands

You need to use Erine#sync method.

Example

const { Erine } = require('erine');

const bot = new Erine({
intents: string[] | GatewayIntentBits[]
owners: string[]
prefix: string | string[] | asyncFunction
});

bot.load(path_to_files);
bot.on('ready', function(bot) {
bot.sync()
.then(() => console.log('Slash commands synced!'));
});

bot.login(string);

Guild syncing

You can sync your commands to certain guilds, by passing an array of snowflakes to the function.

bot.on('ready', function(bot) {
bot.sync(['guildId', 'guildId', 'guildId'])
.then(() => console.log('Slash commands synced!'));
});