Previously known as Perpetual Mechanical Array bot
Discord Bot for Traveler Mains Server
Invite link - click here
If you wish to use this bot in your own server, you will have to modify Constants.ts
file and some other places where stuff is hard coded.
Make a copy of sample.env
file & rename it to .env
.
- Create a new Firebase project
- Download Firebase admin key
- Copy that key into
firebase-service-acc
folder - Rename that key file into something simple, for eg -
firebase-admin-key.json
- Copy the file name & paste it into
GOOGLE_APPLICATION_CREDENTIALS
field of the.env
file OR - Copy
client_email
,private_key
&project_id
fromFirebase admin key
file & paste it into respective field of.env
file. Make sure to copy with double quotes.
- Create a new bot
- Copy Token (from
Bot
page) & paste intoDISCORD_TOKEN
field of the.env
file - Copy Server ID & paste into
GUILD_ID
field of the.env
file
There are 2 methods: With docker or Without docker.
There are 2 methods: Building container from source or Using pre-built container image. In any case, you will need to install Docker.
The best way is to install & start Docker Desktop
OR
For headless install (or where there is no GUI available for e.g. Virtual Private Server Environments)
- Install Docker Engine
- Install Docker Compose
You may also refer this outdated guide
After Docker is installed, run the following command to start the bot.
# This will install dependencies and transpile Typescript code to Javascript code
npm install
npm run build
# This will create a container from scratch
docker compose up -d
You will not need to clone entire repository in this case. But you need to perform pre-requisites.
After you have firebase-service-acc
folder & .env
file ready, create a file docker-compose.yml
and put this:
version: '3.9'
services:
pma-bot:
container_name: perpetual-mechanical-array-bot
image: ghcr.io/mrdgh2821/perpetual-mechanical-array-bot:latest
env_file:
- .env
volumes:
- ./firebase-service-acc:/app/firebase-service-acc:ro
Then run:
docker compose up -d
Clone the repo, complete the pre-requisites and do:
Execute the following:
npm install
npm run dev:start
Pull requests are welcome!
If you wish to do some modifications/testing:
- Complete the pre-requisites except docker part, as listed in Hosting section
- Run:
npm run watch:start
In case of error 401 or 403, you may have to kick out the bot, generate new invite link with bot & application.command scope, invite back the bot & run the command again.
Another solution is to check if the token is set correctly or not. Use console.log(process.env.DISCORD_TOKEN)
to check how token looks. Remove any extra quotation marks at start & end of the token.
This bot is a gift for Traveler Mains discord server, which I have been hosting for free. I'm also bringing new feature updates without charging anything.
If you have benefitted from this bot, and would like to keep the development of this bot active or just want to support me out of good will, please click on the sponsor button.
It will help me keep the bot alive for years to come & keep me motivated to add more features in future.