Verification message is sent.
This commit is contained in:
@@ -7,7 +7,7 @@ from highscores import highscores_data # pylint: disable=import-error
|
|||||||
from utils import data_storage # pylint: disable=import-error
|
from utils import data_storage # pylint: disable=import-error
|
||||||
|
|
||||||
|
|
||||||
class RegisterVerificationChannel(commands.Cog, name="Register HighScore Channel"):
|
class RegisterVerificationChannel(commands.Cog, name="Register Verify Channel"):
|
||||||
"""Registers Verification channel"""
|
"""Registers Verification channel"""
|
||||||
|
|
||||||
def __init__(self, bot: commands.Bot):
|
def __init__(self, bot: commands.Bot):
|
||||||
|
|||||||
+21
-5
@@ -2,13 +2,13 @@
|
|||||||
Bot command to submit a score
|
Bot command to submit a score
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from ast import AsyncFunctionDef
|
||||||
from nextcord.ext import commands
|
from nextcord.ext import commands
|
||||||
from utils import highscore_manage # pylint: disable=import-error
|
from utils import highscore_manage # pylint: disable=import-error
|
||||||
|
from highscores import highscores_data # pylint: disable=import-error
|
||||||
# from utils import highscore_manage # pylint: disable=import-error
|
|
||||||
|
|
||||||
|
|
||||||
class RegisterHighscoreChannel(commands.Cog, name="Score"):
|
class Score(commands.Cog, name="Score"):
|
||||||
"""Submits a score."""
|
"""Submits a score."""
|
||||||
|
|
||||||
def __init__(self, bot: commands.Bot):
|
def __init__(self, bot: commands.Bot):
|
||||||
@@ -23,11 +23,27 @@ class RegisterHighscoreChannel(commands.Cog, name="Score"):
|
|||||||
?score "Boss Name" "Category" "score"
|
?score "Boss Name" "Category" "score"
|
||||||
```
|
```
|
||||||
"""
|
"""
|
||||||
await highscore_manage.submit_score(self, ctx, boss_name, category, score)
|
verification_channel_id = highscores_data["verification_channel_id"]
|
||||||
|
channel = self.bot.get_channel(verification_channel_id)
|
||||||
|
|
||||||
|
if channel is None:
|
||||||
|
response = "Registered Verification channel does not exist or was never registered. \
|
||||||
|
Contact server admins."
|
||||||
|
await ctx.send(response)
|
||||||
|
return
|
||||||
|
else:
|
||||||
|
verification_string = f"{ctx.author.display_name}:{boss_name}:{category}:{score}"
|
||||||
|
|
||||||
|
await channel.send(
|
||||||
|
content=verification_string,
|
||||||
|
files=[await attch.to_file() for attch in ctx.message.attachments],
|
||||||
|
)
|
||||||
|
|
||||||
|
# await highscore_manage.submit_score(self, ctx, boss_name, category, score)
|
||||||
|
|
||||||
|
|
||||||
# This function will be called when this extension is loaded.
|
# This function will be called when this extension is loaded.
|
||||||
# It is necessary to add these functions to the bot.
|
# It is necessary to add these functions to the bot.
|
||||||
def setup(bot: commands.Bot):
|
def setup(bot: commands.Bot):
|
||||||
"""Adds functon to bot"""
|
"""Adds functon to bot"""
|
||||||
bot.add_cog(RegisterHighscoreChannel(bot))
|
bot.add_cog(Score(bot))
|
||||||
|
|||||||
Reference in New Issue
Block a user