Skip to content

Instantly share code, notes, and snippets.

@cyrus01337
Created February 16, 2021 15:37
Show Gist options
  • Save cyrus01337/56777876f09b84add39cb7d9ad43db4f to your computer and use it in GitHub Desktop.
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.
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