Changed send_highscore_message to take guild rather than channel.
This commit is contained in:
@@ -55,9 +55,7 @@ class RefreshCog(commands.Cog, name="Refresh Cog"):
|
||||
)
|
||||
group = session.scalar(stmt)
|
||||
|
||||
channel = interaction.guild.get_channel(group.ChannelId)
|
||||
|
||||
message: nextcord.Message = await send_highscore_message(session, channel, group)
|
||||
message: nextcord.Message = await send_highscore_message(session, interaction.guild, group)
|
||||
await message.edit(view=SubmissionCreateButton(self._bot))
|
||||
|
||||
await interaction.response.send_message(f"Updated table {group.GroupName}!", ephemeral=True)
|
||||
@@ -88,14 +86,7 @@ class RefreshCog(commands.Cog, name="Refresh Cog"):
|
||||
await interaction.response.defer(ephemeral=True)
|
||||
|
||||
for group in session.scalars(stmt):
|
||||
channel = interaction.guild.get_channel(group.ChannelId)
|
||||
|
||||
# Error checking for registered highscore channel
|
||||
error_response = "Registered Highscores channel does not exist or was never registered. "
|
||||
error_response += 'Use "/register" to register channels.'
|
||||
assert channel is not None, await interaction.response(error_response, ephemeral=True)
|
||||
|
||||
message: nextcord.Message = await send_highscore_message(session, channel, group)
|
||||
message: nextcord.Message = await send_highscore_message(session, interaction.guild, group)
|
||||
await message.edit(view=SubmissionCreateButton(self._bot))
|
||||
|
||||
await interaction.send(f"Posted all groups in {interaction.guild.name}'s highscores.", ephemeral=True)
|
||||
|
||||
Reference in New Issue
Block a user