mirror of
https://github.com/Xevion/contest-assistant.git
synced 2025-12-07 22:06:40 -06:00
use payload known params instead of cached message, implement raw_bulk_message_deletion, on_raw_reaction_clear, on_raw_reaction_clear_emoji, helpers.is_upvote for better upvote emote checking
This commit is contained in:
13
bot/helpers.py
Normal file
13
bot/helpers.py
Normal file
@@ -0,0 +1,13 @@
|
||||
from typing import Union
|
||||
|
||||
import discord
|
||||
|
||||
from bot import constants
|
||||
|
||||
|
||||
def is_upvote(emoji: Union[discord.Emoji, discord.PartialEmoji, str]) -> bool:
|
||||
"""Helper function for checking if the emoji returned is the upvote emoji the bot looks for."""
|
||||
if isinstance(emoji, (discord.Emoji, discord.PartialEmoji)):
|
||||
if emoji.id == constants.Emoji.UPVOTE:
|
||||
return True
|
||||
return False
|
||||
Reference in New Issue
Block a user