Skip to main content

@Bot

bot decorator help you manage multiple bot's in single node instance

Signature

Bot(...botIDs: string[]): ClassMethodDecorator;

Supported with

Example

@Discord()
@Bot("alex", "zoe") // Define which bot can run the following commands or events
class Example {
@SimpleCommand()
hello(command: SimpleCommandMessage) {
command.message.reply(`👋 ${message.member}`);
}
}

const alex = new Client({
botId: "alex", // define botId
});

const zoe = new Client({
botId: "zoe", // define botId
});

// We will now build our application to load all the commands/events for both bots.
MetadataStorage.instance.build().then(() => {
// Now that the app is ready, we can login to both bots
alex.login("alex token");
zoe.login("zoe token");
});

Make changes to

It either extends or overwrites data configured in below decorators, however, the order of decorators matters.

@ButtonComponent

@SelectMenuComponent

@ContextMenu

@Discord

@On

@Once

@SimpleCommand

@Slash