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).
This is an interactions-only discord bot hosted on Deta. Its purpose is to serve a basic leaderboards system.
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.
- Make a new project on Deta.
- Make a new application on Discord.
- Click the 'Deploy to Deta' button on this repo.
- Select your project and enter the environment variables.
CLIENT_ID
is the ID in https://discord.com/developers/applications/{id}/informationCLIENT_PUBLIC_KEY
is the key in https://discord.com/developers/applications/{id}/informationCLIENT_SECRET
is the secret in https://discord.com/developers/applications/{id}/oauth2/generalSTAFF_ROLE_ID
is the ID of a staff role in the discord server.
- 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.
- 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.
Click the following button to deploy this Micro in your own Deta project: