# @symbux/turbo-discord

> A discord plugin for the Turbo engine.

Latest version **0.8.8** (published 2023-10-11) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @symbux/turbo-discord
pnpm add @symbux/turbo-discord
yarn add @symbux/turbo-discord
bun add @symbux/turbo-discord
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.8.8 |
| Published | 2023-10-11 |
| First published | 2021-12-29 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 259.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Symbux Dev |
| Maintainers | dannysmc95 |
| Keywords | turbo, engine, services, plugin, discord, oauth2, sso, discord-bot, bot |

## Links

- npm: https://www.npmjs.com/package/@symbux/turbo-discord
- Repository: https://github.com/Symbux/Turbo-Discord
- Homepage: https://github.com/Symbux/Turbo-Discord#readme
- Issues: https://github.com/Symbux/Turbo-Discord/issues
- npm.io page: https://npm.io/package/@symbux/turbo-discord

## Dependencies (4)

- [discord.js](https://npm.io/package/discord.js.md) ^13.16.0
- [cross-fetch](https://npm.io/package/cross-fetch.md) ^4.0.0
- [@discordjs/rest](https://npm.io/package/@discordjs/rest.md) ^2.0.1
- [discord-api-types](https://npm.io/package/discord-api-types.md) ^0.37.60

## Alternatives

- [@pothos/plugin-authz](https://npm.io/package/@pothos/plugin-authz.md) — 12.4K weekly downloads
- [@bounded-sh/client](https://npm.io/package/@bounded-sh/client.md) — 3.2K weekly downloads
- [@luigi-project/plugin-auth-oauth2](https://npm.io/package/@luigi-project/plugin-auth-oauth2.md) — 2.3K weekly downloads
- [@nocobase/plugin-verification](https://npm.io/package/@nocobase/plugin-verification.md) — 2.0K weekly downloads
- [escher-request](https://npm.io/package/escher-request.md) — 545 weekly downloads

## Recent versions

- 0.8.8 (latest) — 2023-10-11
- 0.8.6 — 2023-04-12
- 0.8.5 — 2023-04-12
- 0.8.4 — 2023-04-12
- 0.8.3 — 2023-04-11
- 0.8.2 — 2023-04-11
- 0.8.1 — 2023-04-03
- 0.8.0 — 2022-10-11
- 0.7.0 — 2022-07-23
- 0.6.0 — 2022-05-18
- 0.5.10 — 2022-05-17
- 0.5.9 — 2022-05-17
- 0.5.8 — 2022-05-15
- 0.5.7 — 2022-05-15
- 0.5.6 — 2022-05-15
- … 40 more at https://npm.io/package/@symbux/turbo-discord/versions

## README

<p align="center">
	<a href="#">
		<img width="300" src="https://raw.githubusercontent.com/Symbux/Turbo-Discord/master/logo.svg">
	</a>
</p>

![GitHub Workflow Status](https://img.shields.io/github/workflow/status/Symbux/Turbo-Discord/Build)
![GitHub issues](https://img.shields.io/github/issues/Symbux/Turbo-Discord)
![NPM](https://img.shields.io/npm/l/@symbux/turbo-discord)
![npm (scoped)](https://img.shields.io/npm/v/@symbux/turbo-discord)
![npm](https://img.shields.io/npm/dw/@symbux/turbo-discord)


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.

<br>
<br>

<p align="center">
	<a href="https://discord.gg/3YuNTEMJey" target="_blank">
		<img width="200" src="https://discord.com/assets/cb48d2a8d4991281d7a6a95d2f58195e.svg">
		<p align="center">We are on Discord!</p>
	</a>
</p>

<br>

---

<br>

## Installation

With Yarn:
```bash
yarn add @symbux/turbo @symbux/turbo-discord
```

With NPM:
```bash
npm install --save @symbux/turbo @symbux/turbo-discord
```

<br>

---

<br>

## Getting Started

[You can find the documentation here](https://github.com/Symbux/Turbo-Discord/wiki).

```typescript
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);
});
```

<br>

---

<br>

## 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.

---
_Source: https://npm.io/package/@symbux/turbo-discord · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
