mirror of
https://github.com/Xevion/contest-assistant.git
synced 2025-12-12 01:09:38 -06:00
Implement Submission.update and get/fetch message helper functions
Added and implemented helper functions for getting and fetching messages given a payload's integer channel and message IDs. Implemented Submission.votes list modifications and Submission.update in code (tested with real bot) Committed constants.py containing ReactionMarker used in models.py
This commit is contained in:
@@ -106,3 +106,11 @@ class ContestBot(commands.Bot):
|
||||
for submission in submissions:
|
||||
message: discord.PartialMessage = channel.get_partial_message(submission.id)
|
||||
await message.add_reaction(self.get_emoji(constants.Emoji.UPVOTE))
|
||||
|
||||
def get_message(self, channel_id: int, message_id: int) -> discord.PartialMessage:
|
||||
channel: discord.TextChannel = self.get_channel(channel_id)
|
||||
return channel.get_partial_message(message_id)
|
||||
|
||||
async def fetch_message(self, channel_id: int, message_id: int) -> discord.Message:
|
||||
channel: discord.TextChannel = self.get_channel(channel_id)
|
||||
return await channel.fetch_message(message_id)
|
||||
|
||||
Reference in New Issue
Block a user