Refractor utils to one file.

This commit is contained in:
alwayscompiling
2022-07-03 16:12:15 -04:00
parent 35aa1f34f4
commit f29e459b2e
7 changed files with 165 additions and 177 deletions
+4 -4
View File
@@ -5,8 +5,8 @@ Bot command to post the highscores
from nextcord.ext import commands
from highscores import highscores_config # pylint: disable=import-error
from highscores import highscores_data # pylint: disable=import-error
from utils import data_storage # pylint: disable=import-error
from utils import highscore_message # pylint: disable=import-error
from utils.utils import save_highscores_data # pylint: disable=import-error
from utils.utils import send_highscore_message # pylint: disable=import-error
class PostHighscores(commands.Cog, name="Post Highscores"):
@@ -34,9 +34,9 @@ class PostHighscores(commands.Cog, name="Post Highscores"):
assert channel is not None, await ctx.send(error_response)
for boss in highscores_config["bosses"]:
await highscore_message.send_highscore_message(channel, boss["boss"])
await send_highscore_message(channel, boss["boss"])
data_storage.save_highscores_data(highscores_data)
save_highscores_data(highscores_data)
# This function will be called when this extension is loaded.
+2 -2
View File
@@ -4,7 +4,7 @@ Bot command to register the highscores channel
from nextcord.ext import commands
from highscores import highscores_data # pylint: disable=import-error
from utils import data_storage # pylint: disable=import-error
from utils.utils import save_highscores_data # pylint: disable=import-error
class RegisterHighscoreChannel(commands.Cog, name="Register HighScore Channel"):
@@ -25,7 +25,7 @@ class RegisterHighscoreChannel(commands.Cog, name="Register HighScore Channel"):
# respond to the message
await ctx.send(f"Registered <#{ctx.channel.id}> as channel to post highscores in.")
highscores_data["highscore_channel_id"] = ctx.channel.id
data_storage.save_highscores_data(highscores_data)
save_highscores_data(highscores_data)
# This function will be called when this extension is loaded.
@@ -4,7 +4,7 @@ Bot command to register the verification channel
from nextcord.ext import commands
from highscores import highscores_data # pylint: disable=import-error
from utils import data_storage # pylint: disable=import-error
from utils.utils import save_highscores_data # pylint: disable=import-error
class RegisterVerificationChannel(commands.Cog, name="Register Verify Channel"):
@@ -25,7 +25,7 @@ class RegisterVerificationChannel(commands.Cog, name="Register Verify Channel"):
# respond to the message
await ctx.send(f"Registered <#{ctx.channel.id}> as channel to post verifications in.")
highscores_data["verification_channel_id"] = ctx.channel.id
data_storage.save_highscores_data(highscores_data)
save_highscores_data(highscores_data)
# This function will be called when this extension is loaded.