def tick(self, tick_type: str, *, raw: bool = False, guild: Guild = None) -> str:
"""
Returns a custom tick emoji.
Args:
tick_type: The tick type to return. Either "green" or "red".
raw: Specifies whether the returned tick shouldn't be in emoji message formatting form.
guild: Specifies the guild that this reaction will be used in. Used in checking if we can actually use the
ticks. If not, we return the unicode alternatives instead.
Returns: The tick.
"""
raw_tick = '\U00002705' if tick_type == 'green' else '\U0000274c'
# use raw ticks if we can't use external emoji, or we want to
if guild and not guild.me.guild_permissions.external_emojis:
return raw_tick
try:
# fetch tick from config
custom_tick = self.cfg['bot']['emoji'][tick_type + '_tick']
return custom_tick if raw else f'<:{custom_tick}>'
except KeyError:
return raw_tick
评论列表
文章目录