You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# TODO: make it not error out if the emoji isnt from the guild
awaitinteraction.followup.send(embed=embed)
# TODO: make it not error out if the emoji isnt from the guild@commands.command(name="emojiinfo", description="Get information about an emoji. (put emoji as parameter)" )asyncdefemoji_info(self, ctx: commands.Context[commands.Bot], emoji: discord.Emoji) ->None:
""" Get information about an emoji. Parameters ---------- ctx : commands.Context[commands.Bot] The context object. emoji : discord.Emoji The emoji to get information about. """# create custom embedembed=discord.Embed(
title=f"Emoji Info for {emoji.name}",
color=CONST.EMBED_STATE_COLORS["DEBUG"],
)
embed.add_field(name="Name", value=emoji.name, inline=True)
embed.add_field(name="ID", value=emoji.id, inline=True)
embed.add_field(name="URL", value=emoji.url, inline=False)
# set the emoji image as the thumbnailembed.set_thumbnail(url=emoji.url)
# get the emojis usage stats if it existsemoji_stats=awaitself.db_controller.get_emoji_stats(emoji.id)
ifemoji_stats:
embed.add_field(name="Usage Count", value=emoji_stats.count, inline=True)
# find how the emoji ranks in the guildemoji_stats=awaitself.db_controller.get_all_emoji_stats()
emoji_stats=sorted(emoji_stats, key=lambdax: x.count, reverse=True)
rank=next(
(
index+1forindex, emoji_statinenumerate(emoji_stats)
ifemoji_stat.emoji_id==emoji.id
),
None,
)
embed.add_field(name="Rank", value=rank, inline=True)
awaitctx.send(embed=embed)
@commands.Cog.listener()asyncdefon_message(self, message: discord.Message) ->None:
"""
The text was updated successfully, but these errors were encountered:
tux/tux/cogs/misc/emojistats.py
Line 49 in b66020c
The text was updated successfully, but these errors were encountered: