Skip to content

A Discord plugin that expands the Turbo engine to be able to work with and manage Discord bots, SSO with Discord and more using customised command controllers, with latest support for slash commands, buttons, select menus, autocomplete, events, modals and more.

License

Symbux/Turbo-Discord

Repository files navigation

GitHub Workflow Status GitHub issues NPM npm (scoped) npm

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.



We are on Discord!




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.

About

A Discord plugin that expands the Turbo engine to be able to work with and manage Discord bots, SSO with Discord and more using customised command controllers, with latest support for slash commands, buttons, select menus, autocomplete, events, modals and more.

Topics

Resources

License

Stars

Watchers

Forks