Compare commits

..

No commits in common. "7496c4316189056614b315cc9c8f013c55b3c718" and "bfc55bf2a51f13915c99af25744c293a4fef11dd" have entirely different histories.

View file

@ -5,8 +5,7 @@ EXT_NAME = "endcord_aemoji"
EXT_VERSION = "0.1.0" EXT_VERSION = "0.1.0"
EXT_ENDCORD_VERSION = "1.4.2" EXT_ENDCORD_VERSION = "1.4.2"
EXT_DESCRIPTION = "View animated custom emoji as GIFs" EXT_DESCRIPTION = "View animated custom emoji as GIFs"
EXT_SOURCE = "https://git.silvertke.net/SilverTke/endcord-aemoji" EXT_COMMAND_ASSIST = ("view_aemoji - View animated emoji", "view_aemoji")
EXT_COMMAND_ASSIST = (("view_aemoji - View animated emoji", "view_aemoji"),)
EMOJI_RE = re.compile("^<:(.+):(\d+)>$") EMOJI_RE = re.compile("^<:(.+):(\d+)>$")
@ -23,19 +22,15 @@ class Extension:
def __init__(self, app): def __init__(self, app):
self.app: Endcord = app self.app: Endcord = app
def on_execute_command( def on_execute_command(self, command_text: str, chat_sel: int, tree_sel: int):
self, command_text: str, chat_sel: int, tree_sel: int
) -> bool:
if command_text.startswith("view_aemoji"): if command_text.startswith("view_aemoji"):
try: try:
emoji = command_text.split(" ")[1] emoji = command_text.split(" ")[1]
except IndexError: except IndexError:
self.app.update_extra_line("Emoji argument not given") self.app.update_extra_line("Emoji argument not given")
return True return
emoji_url = get_emoji_url(emoji) emoji_url = get_emoji_url(emoji)
if emoji_url is None: if emoji_url is None:
self.app.update_extra_line("Invalid emoji") self.app.update_extra_line("Invalid emoji")
return True return
self.app.download_file(emoji_url, open_media=True) self.app.download_file(emoji_url, open_media=True)
return True
return False