@symbux/turbo-discord
v0.8.8
Published
A discord plugin for the Turbo engine.
Downloads
64
Maintainers
Readme
The Turbo Plugin Discord is an extension to the Turbo engine that offers support for managing and controlling a discord bot, to work inline with the familiar controller structure.
Installation
With Yarn:
yarn add @symbux/turbo @symbux/turbo-discord
With NPM:
npm install --save @symbux/turbo @symbux/turbo-discord
Getting Started
You can find the documentation here.
import { Engine, HttpPlugin } from '@symbux/turbo';
import DiscordPlugin from '@symbux/turbo-discord';
// Initialise engine instance.
const engine = new Engine({
autowire: true,
});
// Register the http plugin for Discord SSO.
engine.use(new HttpPlugin({
port: parseInt(String(process.env.PORT)) || 5500,
}));
// Register the discord plugin.
engine.use(new DiscordPlugin({
bot: {
token: String(process.env.BOT_TOKEN),
interval: 5,
activities: [
{ type: 'WATCHING', text: 'the server.' },
{ type: 'WATCHING', text: 'the economy.' },
{ type: 'WATCHING', text: 'the farms.' },
{ type: 'WATCHING', text: 'the factions.' },
],
},
oauth: {
id: String(process.env.CLIENT_ID),
baseUrl: 'http://localhost:5500/auth',
scopes: ['identify', 'guilds', 'email', 'connections'],
secret: String(process.env.CLIENT_SECRET),
},
}));
// Start engine.
engine.start().catch((err) => {
console.error(err);
});
Features
- Discord bot slash command support.
- Helper functions for creating intuitive user experiences.
- Embed builder and quick access functionality.
- Built in OAuth functionality for SSO with Discord.
- Support for command option autocomplete using built in class router.
- Support for context menu's in commands and generic context menu classes.