Moved all commands into single commands cog.
This commit is contained in:
@@ -0,0 +1,18 @@
|
|||||||
|
"""
|
||||||
|
Cog loader. Adds all command classes as cogs to the bot.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from nextcord.ext import commands
|
||||||
|
|
||||||
|
# Command classes
|
||||||
|
from .delete_scores import DeleteScores
|
||||||
|
from .post_highscores import PostHighscores
|
||||||
|
from .register import Register
|
||||||
|
|
||||||
|
# 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):
|
||||||
|
"""Adds all command classes to bot."""
|
||||||
|
bot.add_cog(DeleteScores())
|
||||||
|
bot.add_cog(PostHighscores(bot))
|
||||||
|
bot.add_cog(Register())
|
||||||
@@ -42,10 +42,3 @@ class DeleteScores(commands.Cog, name="Delete Scores"):
|
|||||||
await interaction.response.send_message(
|
await interaction.response.send_message(
|
||||||
"You shouldn't be using this message.", ephemeral=True
|
"You shouldn't be using this message.", ephemeral=True
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
# 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):
|
|
||||||
"""Adds function to bot"""
|
|
||||||
bot.add_cog(DeleteScores())
|
|
||||||
@@ -59,10 +59,3 @@ class PostHighscores(commands.Cog, name="Post Highscores"):
|
|||||||
highscores_data.save_guild_data(guild)
|
highscores_data.save_guild_data(guild)
|
||||||
|
|
||||||
await interaction.followup.send(f"Posted all tables to <#{channel.id}>.", ephemeral=True)
|
await interaction.followup.send(f"Posted all tables to <#{channel.id}>.", ephemeral=True)
|
||||||
|
|
||||||
|
|
||||||
# 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):
|
|
||||||
"""Adds function to bot"""
|
|
||||||
bot.add_cog(PostHighscores(bot))
|
|
||||||
@@ -105,10 +105,3 @@ class Register(commands.Cog, name="Register"):
|
|||||||
await interaction.send(f"Registered <#{channel_id}>.", ephemeral=True)
|
await interaction.send(f"Registered <#{channel_id}>.", ephemeral=True)
|
||||||
guild.verification_channel = channel_id
|
guild.verification_channel = channel_id
|
||||||
highscores_data.save_guild_data(guild)
|
highscores_data.save_guild_data(guild)
|
||||||
|
|
||||||
|
|
||||||
# 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) -> None:
|
|
||||||
"""Adds function to bot"""
|
|
||||||
bot.add_cog(Register())
|
|
||||||
Reference in New Issue
Block a user