Created
February 16, 2021 15:37
-
-
Save cyrus01337/56777876f09b84add39cb7d9ad43db4f to your computer and use it in GitHub Desktop.
Function that grabs emotes based on name - useful for those without Nitro attemping to grab the formatting of animated emotes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import discord | |
def get_emoji_format(name: str): | |
guild_obj: discord.Guild = None | |
if os.environ.get("JISHAKU_NO_UNDERSCORE", False): | |
guild_obj = guild | |
else: | |
guild_obj = _guild | |
return str(discord.utils.get(guild.emojis, name=name)) | |
# can be used like so: | |
fmt = get_emoji_format("ardannypeek") | |
return (f"```\n" | |
f"{fmt}\n" | |
f"```") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment