A Discord bot for the Sourcemod Surftimer plugin.
This bot provides basic commands such as /playerstats <playerid>
, /mapstats <mapname>
and /top
.
It uses the discord.js library and the prisma ORM.
- A huge thanks to Sayt123 for their collection of surf map images, without which this bot would not look nearly as good!
- Install Docker.
- Create a directory called
SurfTimer-Bot
---mkdir SurfTimer-Bot
- In this directory, create a file named
Dockerfile
---nano SurfTimer-Bot/Dockerfile
. - In this file, paste the contents of this file.
- In the same directory, create a file named
.env
---nano SurfTimer-Bot/.env
- In this file, paste the contents of this file.
- Edit the environment variables accordingly (follow the URL for a detailed guide).
- Run the following command to build the Docker image:
docker build SurfTimer-Bot/ -t surftimer-bot
- Now run the container with the following command:
docker run -d --env-file=SurfTimer-Bot/.env surftimer-bot
- Install Node.js (v16.13.2 minimum!) and NPM (should be installed with Node).
- Clone this repository or download its content somewhere.
- Create a file named
.env
. - In this file, paste the contents of this file.
- Edit the environment variables accordingly (follow the URL for a detailed guide).
- Open a terminal and run
npm i && npm run build
- To start the bot, run
npm run start
This project uses TypeScript, Axios, and the Prisma ORM. It takes advantage of Discord.js to interact with the Discord API.
This project has been created for easy collaboration. You SHOULD use Visual Studio Code to work on this project, as it uses TypeScript and the Prisma ORM, as well as a debugging server, all configured to work with VSCode out of the box.
- Fork the repository and clone it somewhere on your machine.
- Make sure Node.js (v16.13.2 minimum!) and NPM (should be installed with Node) are installed.
- Create a file named
.env
. - In this file, paste the contents of this file.
- Edit the environment variables accordingly (follow the URL for a detailed guide).
- Run
npm i
to install the dependencies. - Open a terminal in VSCode and type
npm run watch
. - Once you want to run the bot, hit F5, the bot should start in a debug session.
The only thing contributors can do is to add new commands (if you have anything in mind, feel free to PR of course). To do so, all you have to do is create a file in the commands
folder and adapt the code from another command such as top.ts
.