Skip to content

Sneaks-Community/SurfTimer-Discord-Bot

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SurfTimer-Discord-Bot

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.

Credits

  • A huge thanks to Sayt123 for their collection of surf map images, without which this bot would not look nearly as good!

How to use it

Using Docker (recommended)

  1. Install Docker.
  2. Create a directory called SurfTimer-Bot --- mkdir SurfTimer-Bot
  3. In this directory, create a file named Dockerfile --- nano SurfTimer-Bot/Dockerfile.
  4. In this file, paste the contents of this file.
  5. In the same directory, create a file named .env --- nano SurfTimer-Bot/.env
  6. In this file, paste the contents of this file.
  7. Edit the environment variables accordingly (follow the URL for a detailed guide).
  8. Run the following command to build the Docker image: docker build SurfTimer-Bot/ -t surftimer-bot
  9. Now run the container with the following command: docker run -d --env-file=SurfTimer-Bot/.env surftimer-bot

Using Node.js

  1. Install Node.js (v16.13.2 minimum!) and NPM (should be installed with Node).
  2. Clone this repository or download its content somewhere.
  3. Create a file named .env.
  4. In this file, paste the contents of this file.
  5. Edit the environment variables accordingly (follow the URL for a detailed guide).
  6. Open a terminal and run npm i && npm run build
  7. To start the bot, run npm run start

Tech Stack

This project uses TypeScript, Axios, and the Prisma ORM. It takes advantage of Discord.js to interact with the Discord API.

Contributing

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.

Running locally

  1. Fork the repository and clone it somewhere on your machine.
  2. Make sure Node.js (v16.13.2 minimum!) and NPM (should be installed with Node) are installed.
  3. Create a file named .env.
  4. In this file, paste the contents of this file.
  5. Edit the environment variables accordingly (follow the URL for a detailed guide).
  6. Run npm i to install the dependencies.
  7. Open a terminal in VSCode and type npm run watch.
  8. Once you want to run the bot, hit F5, the bot should start in a debug session.

Adding commands

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.

About

A Discord bot for the Sourcemod Surftimer plugin.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 97.5%
  • Dockerfile 2.5%