Updated comments in message listener.
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
"""
|
"""
|
||||||
Bot command to submit a score
|
Defines cog for on message listener.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from nextcord.ext import commands
|
from nextcord.ext import commands
|
||||||
@@ -9,15 +9,15 @@ from highscores import submission_messages # pylint: disable=import-error
|
|||||||
from highscores import highscores_data # pylint: disable=import-error
|
from highscores import highscores_data # pylint: disable=import-error
|
||||||
|
|
||||||
|
|
||||||
class Score(commands.Cog, name="Message Listener"):
|
class SubmissionListener(commands.Cog, name="Message Listener"):
|
||||||
"""Submits a score."""
|
"""Sets up message listener."""
|
||||||
|
|
||||||
def __init__(self, bot: commands.Bot):
|
def __init__(self, bot: commands.Bot):
|
||||||
self.bot = bot
|
self.bot = bot
|
||||||
|
|
||||||
@commands.Cog.listener()
|
@commands.Cog.listener()
|
||||||
async def on_message(self, proof_message: nextcord.Message):
|
async def on_message(self, proof_message: nextcord.Message):
|
||||||
"""Listener for message creation."""
|
"""Listener for message creation. Adds score and attachments to submission."""
|
||||||
for user_id, message_id in submission_messages.items():
|
for user_id, message_id in submission_messages.items():
|
||||||
submission_message: nextcord.Message = await self.bot.get_channel(
|
submission_message: nextcord.Message = await self.bot.get_channel(
|
||||||
highscores_data["submission_channel_id"]
|
highscores_data["submission_channel_id"]
|
||||||
@@ -42,4 +42,4 @@ class Score(commands.Cog, name="Message Listener"):
|
|||||||
# 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 function to bot"""
|
"""Adds function to bot"""
|
||||||
bot.add_cog(Score(bot))
|
bot.add_cog(SubmissionListener(bot))
|
||||||
|
|||||||
Reference in New Issue
Block a user