From 7d19b42cd84f42f576d358583629e267ec87ef00 Mon Sep 17 00:00:00 2001 From: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com> Date: Fri, 26 Aug 2022 01:55:03 +0000 Subject: [PATCH] fix: fmt --- rest/restManager.ts | 4 +--- template/bigbot/README.md | 15 +++++++++------ template/bigbot/src/configs.ts | 4 ++-- template/bigbot/src/rest/README.md | 6 ++++-- template/bigbot/src/rest/index.ts | 8 +------- 5 files changed, 17 insertions(+), 20 deletions(-) diff --git a/rest/restManager.ts b/rest/restManager.ts index 65d374cd2..bc001db04 100644 --- a/rest/restManager.ts +++ b/rest/restManager.ts @@ -87,9 +87,7 @@ export function createRestManager(options: CreateRestManagerOptions) { response: Response, ) { options.debug?.( - `[REST - fetched] URL: ${opts.url} | Status: ${response.status} ${ - JSON.stringify(opts) - }`, + `[REST - fetched] URL: ${opts.url} | Status: ${response.status} ${JSON.stringify(opts)}`, ); }, }; diff --git a/template/bigbot/README.md b/template/bigbot/README.md index d4d8f0086..548dbe041 100644 --- a/template/bigbot/README.md +++ b/template/bigbot/README.md @@ -2,7 +2,9 @@ Support: -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. \ No newline at end of file +- Change configs.ts file to use an .env file. diff --git a/template/bigbot/src/configs.ts b/template/bigbot/src/configs.ts index 03d0e753c..ed36310f8 100644 --- a/template/bigbot/src/configs.ts +++ b/template/bigbot/src/configs.ts @@ -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 = ""; \ No newline at end of file +export const INFLUX_URL = ""; diff --git a/template/bigbot/src/rest/README.md b/template/bigbot/src/rest/README.md index 6f3bc17b6..5629d2809 100644 --- a/template/bigbot/src/rest/README.md +++ b/template/bigbot/src/rest/README.md @@ -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. diff --git a/template/bigbot/src/rest/index.ts b/template/bigbot/src/rest/index.ts index d0e770196..d1602dfc2 100644 --- a/template/bigbot/src/rest/index.ts +++ b/template/bigbot/src/rest/index.ts @@ -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,