send highscore message doesn't need to return the message, its never used.
This commit is contained in:
+3
-8
@@ -328,9 +328,7 @@ def get_time_str(time_in: float) -> str:
|
|||||||
return time.strftime(f"%-M:%S.{milliseconds}", time.gmtime(time_in))
|
return time.strftime(f"%-M:%S.{milliseconds}", time.gmtime(time_in))
|
||||||
|
|
||||||
|
|
||||||
async def send_highscore_message(
|
async def send_highscore_message(session: Session, guild: nextcord.Guild, group: CategoryGroup) -> None:
|
||||||
session: Session, guild: nextcord.Guild, group: CategoryGroup
|
|
||||||
) -> nextcord.Message | None:
|
|
||||||
"""
|
"""
|
||||||
Function takes care of checking if a message exists for a group.
|
Function takes care of checking if a message exists for a group.
|
||||||
|
|
||||||
@@ -340,9 +338,6 @@ async def send_highscore_message(
|
|||||||
session (Session): The sqlalchemy session being used for this function call.
|
session (Session): The sqlalchemy session being used for this function call.
|
||||||
guild (nextcord.Guild): the nextcord.Guild object requesting this message.
|
guild (nextcord.Guild): the nextcord.Guild object requesting this message.
|
||||||
group (CategoryGroup): group to post to the message.
|
group (CategoryGroup): group to post to the message.
|
||||||
|
|
||||||
Returns:
|
|
||||||
nextcord.Message: Message object that was posted with group contents. None if cannot send message.
|
|
||||||
"""
|
"""
|
||||||
highscore_string = format_highscore_message(session, group)
|
highscore_string = format_highscore_message(session, group)
|
||||||
channel = guild.get_channel(group.channel_id)
|
channel = guild.get_channel(group.channel_id)
|
||||||
@@ -351,7 +346,7 @@ async def send_highscore_message(
|
|||||||
agon_logger.error(
|
agon_logger.error(
|
||||||
"Channel id %s in guild %s is does not correspond to a TextChannel.", channel.id, channel.guild.id
|
"Channel id %s in guild %s is does not correspond to a TextChannel.", channel.id, channel.guild.id
|
||||||
)
|
)
|
||||||
return None
|
return
|
||||||
|
|
||||||
if group.message_id is None:
|
if group.message_id is None:
|
||||||
# message doesn't exist.
|
# message doesn't exist.
|
||||||
@@ -362,7 +357,7 @@ async def send_highscore_message(
|
|||||||
message: nextcord.Message = await channel.fetch_message(group.message_id)
|
message: nextcord.Message = await channel.fetch_message(group.message_id)
|
||||||
await message.edit(content=highscore_string)
|
await message.edit(content=highscore_string)
|
||||||
|
|
||||||
return message
|
return
|
||||||
|
|
||||||
|
|
||||||
async def submit_score(
|
async def submit_score(
|
||||||
|
|||||||
Reference in New Issue
Block a user