Files
discordeno/template/bigbot
Jonathan Ho a8a89d4b16 feat(Bigbot): added docker-compose (#2538)
* chore: fix script extension

* chore: remove extention

* fix: at least it run can now

* chore: fix dev script

* refactor: change to use env file for config

* chore: update readme

* refactor: put dotenv to top

* feat: add docker and influxdb

* chore: disable deno fmt on bigbot node_modules

* style: deno fmt

* style: deno fmt after upgrade deno

* chore: remove dev console.log

* chore: reverse the influxdb env

* chore: limit the influxdb to localhost

* refactor: seperate build process

* chore: add user pass docs

* refactor: route all to handler

* fix: skip if webhook not exist

* fix: change to use runMethod for send response

* chore: gateway don't depend on bot

* fix: skip if webhook not exist

* fix: first command and error reply not sending

* fix: add try catch to error reply

* fix: reverse interactive.reply

* feat: add fetch analytics to bot process
2022-10-22 07:28:33 -05:00
..
2022-08-28 23:09:18 +00:00
2022-10-20 09:44:34 -05:00
2022-10-20 09:44:34 -05:00

Discordeno Big Bot Template

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.

Make sure to install the latest version when you use it.

Setup

  1. Run a find all for // SETUP-DD-TEMP: and follow all instructions and delete the comments as you finish them.

Startup

There are two ways to start your bot, using docker and node. Using docker will be the simplest and easiest way to start your bot. The default configuation will be set for Docker.

Using Docker

The docker compose file include the discordeno bot and influxdb, this would create an enviroment more close to the production enviroment.

First, rename the .env.example file to .env, and set the discord token and your dev guild id, change the REST_URL to rest and EVENT_HANDLER_URL to bot, copy the value of DOCKER_INFLUXDB_INIT_xxxx to INFLUX_xxxx

Then, run ... to build/rebuild the bot

  • docker-compose build

And, run ... to start

  • docker-compose up -d

Your bot should be running now, and you can check the rest process fetch analytics in influxdb's webgui - http://localhost:8086 with the username and password in the .env file.

Using Node

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.

First, rename the .env.example file to .env, and set the discord token and your dev guild id, change the REST_URL and EVENT_HANDLER_URL to localhost, change value of INFLUX_xxxx to your influxdb config

Then compile everything with npm run build.

After that, you can start your bot one by one with the following order.

  • Start REST
    • npm run startr
  • Start Bot
    • npm run startb
  • Start Gateway
    • npm run startg