@symbux/turbo-discord
TypeScript icon, indicating that this package has built-in type declarations

0.8.8 • Public • Published

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.

Package Sidebar

Install

npm i @symbux/turbo-discord

Weekly Downloads

0

Version

0.8.8

License

Apache-2.0

Unpacked Size

266 kB

Total Files

99

Last publish

Collaborators

  • dannysmc95