Rename bot.py for namespace reasons. Added register command. Added highscores config file.

This commit is contained in:
alwayscompiling
2022-06-25 23:41:14 -04:00
parent 6c28150d36
commit 20ec3f7ac9
3 changed files with 267 additions and 0 deletions
@@ -0,0 +1,27 @@
from nextcord.ext import commands
import highscores # pylint: disable=import-error
class RegisterHighscoreChannel(commands.Cog, name="Register HighScore Channel"):
def __init__(self, bot: commands.Bot):
self.bot = bot
@commands.command(name="register")
async def ping(self, ctx: commands.Context):
"""A command which registers the channel command is sent in as channel to post highscores in
Usage:
```
?register (in channel to post highscores in)
```
"""
# log in console that a ping was received
print(f"Registering {ctx.channel.id}.")
print(bot.open_highscores_data())
# respond to the message
await ctx.send(f"Registered <#{ctx.channel.id}> as channel to post highscores in.")
# This function will be called when this extension is loaded.
# It is necessary to add these functions to the bot.
def setup(bot: commands.Bot):
bot.add_cog(RegisterHighscoreChannel(bot))