This commit is contained in:
Skillz4Killz
2022-08-26 01:55:03 +00:00
committed by GitHub
parent e0038f67ca
commit 7d19b42cd8
5 changed files with 17 additions and 20 deletions
+9 -6
View File
@@ -2,7 +2,9 @@
Support: <https://discord.gg/ddeno>
This template is designed for bots that aim or are already in millions of Discord servers. It is written with Node.js as currently Deno & Bun are not ready to run something at such a scale. The general idea of this template can be modified for any other runtime if this improves in the future.
This template is designed for bots that aim or are already in millions of Discord servers. It is written with Node.js as
currently Deno & Bun are not ready to run something at such a scale. The general idea of this template can be modified
for any other runtime if this improves in the future.
## Setup
@@ -10,17 +12,18 @@ This template is designed for bots that aim or are already in millions of Discor
## Startup
To start your bot, you will need to start a few processes. The instructions below will use `node` but you can use something like `pm2` to help keep your processes alive.
To start your bot, you will need to start a few processes. The instructions below will use `node` but you can use
something like `pm2` to help keep your processes alive.
Please compile everything first with `tsc`.
- Start REST
- `ts-node src/rest/index.ts`
- `ts-node src/rest/index.ts`
- Start Gateway
- `ts-node src/gateway/index.ts`
- `ts-node src/gateway/index.ts`
- Start Bot
- `ts-node src/bot/index.ts`
- `ts-node src/bot/index.ts`
## Improvements
- Change configs.ts file to use an .env file.
- Change configs.ts file to use an .env file.
+2 -2
View File
@@ -1,5 +1,5 @@
/** The discord bot token, without the BOT prefix. */
// SETUP-DD-TEMP: Add the bot token here.
// SETUP-DD-TEMP: Add the bot token here.
export const DISCORD_TOKEN = "";
/** The authorization code that the REST proxy will check for to make sure the requests are coming from you. */
@@ -19,4 +19,4 @@ export const REST_URL = `http://localhost:${REST_PORT}`;
export const INFLUX_BUCKET = "";
export const INFLUX_ORG = "";
export const INFLUX_TOKEN = "";
export const INFLUX_URL = "";
export const INFLUX_URL = "";
+4 -2
View File
@@ -1,7 +1,9 @@
# REST Proxy
This folder will contain the code for our REST proxy. This is going to become the single source that all of our bot will use to communciate to the Discord API.
This folder will contain the code for our REST proxy. This is going to become the single source that all of our bot will
use to communciate to the Discord API.
## Further Steps
- Express framework to create the listener however, you can replace it with anything you like. Express is quite a bloated framework. Feel free to optimize to a better framework.
- Express framework to create the listener however, you can replace it with anything you like. Express is quite a
bloated framework. Feel free to optimize to a better framework.
+1 -7
View File
@@ -3,13 +3,7 @@ import { BASE_URL, createRestManager } from "discordeno";
import express, { Request, Response } from "express";
import { Influx } from "../analytics";
import {
DISCORD_TOKEN,
INFLUX_TOKEN,
REST_AUTHORIZATION,
REST_PORT,
REST_URL,
} from "../configs";
import { DISCORD_TOKEN, INFLUX_TOKEN, REST_AUTHORIZATION, REST_PORT, REST_URL } from "../configs";
const rest = createRestManager({
token: DISCORD_TOKEN,