Add EmojiInfo cog #27

Merged
cswimr merged 27 commits from emoji into main 2024-05-08 16:07:30 -04:00
Showing only changes of commit e1bfa79cb9 - Show all commits

View file

@ -39,7 +39,7 @@ class PartialEmoji(discord.PartialEmoji):
The group name of the emoji if it is a native emoji. The group name of the emoji if it is a native emoji.
""" """
def __init__(self, *, name: str, animated: bool = False, id: int | None = None, group: str | None = None, aliases: list | None = None) -> None: def __init__(self, *, name: str, animated: bool = False, id: int | None = None, group: str | None = None, aliases: list | None = None) -> None: # pylint: disable=redefined-builtin
super().__init__(name=name, animated=animated, id=id) super().__init__(name=name, animated=animated, id=id)
self.group = group self.group = group
self.aliases = aliases self.aliases = aliases
@ -78,7 +78,7 @@ class PartialEmoji(discord.PartialEmoji):
return cls(name=name, animated=animated, id=emoji_id) return cls(name=name, animated=animated, id=emoji_id)
path: data_manager.Path = data_manager.bundled_data_path(coginstance) / "emojis.json" path: data_manager.Path = data_manager.bundled_data_path(coginstance) / "emojis.json"
with open(path, "r") as file: with open(path, "r", encoding="UTF-8") as file:
emojis: dict = json.load(file) emojis: dict = json.load(file)
emoji_aliases = [] emoji_aliases = []
for dict_name, group in emojis.items(): for dict_name, group in emojis.items():