Skip to content

imptype/leaderboards-discord-bot

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FEB 14 2023 UPDATE: Deta Cloud moved to Deta Space

This guide is partially broken. The code still works but the steps for deploying/hosting is different. Use https://github.com/imptype/deta-space-fastapi-example for the updated steps, and you'll need to modify the Spacefile to include the environment variables (check the docs).

Information

This is an interactions-only discord bot hosted on Deta. Its purpose is to serve a basic leaderboards system.

Commands

An asterisk (*) means staff can only use it.

  • /ping - pings the bot.
  • */1v1 <winner> <loser> - winner awarded 5 points and loser deducted 5 points.
  • */setpoints <user> <points> - gives the user points.
  • /getpoints <user> - views the user's points.
  • */getall - views everyone's points, in descending order, capped at 4000 characters.

Running the bot

  1. Make a new project on Deta.
  2. Make a new application on Discord.
  3. Click the 'Deploy to Deta' button on this repo.
  4. Select your project and enter the environment variables.
  5. Once deployed, visit this page of the Micro's URL https://{id}.deta.dev/update_commands to register the slash commands for the first time.
  6. Set the Interactions Endpoint URL to https://{id}.deta.dev/discord in https://discord.com/developers/applications/{id}/information.

Refresh Discord if the slash commands don't show up immediately.

Deploy

Click the following button to deploy this Micro in your own Deta project:

Deploy

About

A basic leaderboards Discord bot.

Resources

License

Stars

Watchers

Forks

Languages

  • Python 100.0%