Add HighscoresData to register command. Add channel setting functions.

This commit is contained in:
alwayscompiling
2022-07-28 10:25:56 -04:00
parent f497928054
commit 64004329da
2 changed files with 32 additions and 9 deletions
+3 -7
View File
@@ -6,7 +6,6 @@ from nextcord import Embed
from nextcord.ext import commands
from highscores import highscores_data # pylint: disable=import-error
from utilities.data_storage import save_highscores_data # pylint: disable=import-error
class RegisterVerificationChannel(commands.Cog, name="Register"):
@@ -29,17 +28,16 @@ class RegisterVerificationChannel(commands.Cog, name="Register"):
"""
# respond to the message
channel_id = ctx.channel.id
guild_data = highscores_data[str(ctx.guild.id)]
if registration_type == "verify":
await ctx.send(f"Registered <#{channel_id}> as channel to post verifications in.")
guild_data["verification_channel_id"] = channel_id
highscores_data.set_guild_verification_channel(ctx.guild.id, channel_id)
elif registration_type == "highscore":
await ctx.send(f"Registered <#{channel_id}> as channel to post highscores in.")
guild_data["highscore_channel_id"] = channel_id
highscores_data.set_guild_highscore_channel(ctx.guild.id, channel_id)
elif registration_type == "submission":
await ctx.send(f"Registered <#{channel_id}> as channel to post submissions in.")
guild_data["submission_channel_id"] = channel_id
highscores_data.set_guild_submission_channel(ctx.guild.id, channel_id)
else:
embed = Embed(
title="Register command help", description="How to use the register command."
@@ -58,8 +56,6 @@ class RegisterVerificationChannel(commands.Cog, name="Register"):
embed.add_field(name="?register help", value="Use to show this message.")
await ctx.reply(embed=embed)
save_highscores_data(highscores_data)
# This function will be called when this extension is loaded.
# It is necessary to add these functions to the bot.