@@ -659,15 +659,15 @@ class Emote:
659659 Represents an Emote.
660660
661661 .. note::
662-
662+
663663 It seems twitch is sometimes returning duplicate information from the emotes endpoint.
664664 To deduplicate your emotes, you can call ``set()`` on the list of emotes (or any other hashmap), which will remove the duplicates.
665665
666666 .. code-block:: python
667667
668668 my_list_of_emotes = await user.get_user_emotes(...)
669669 deduplicated_emotes = set(my_list_of_emotes)
670-
670+
671671 Attributes
672672 -----------
673673 id: :class:`str`
@@ -701,7 +701,18 @@ class Emote:
701701 Whether this emote is available in dark theme background mode.
702702 """
703703
704- __slots__ = "id" , "set_id" , "owner_id" , "name" , "type" , "scales" , "format_static" , "format_animated" , "theme_light" , "theme_dark"
704+ __slots__ = (
705+ "id" ,
706+ "set_id" ,
707+ "owner_id" ,
708+ "name" ,
709+ "type" ,
710+ "scales" ,
711+ "format_static" ,
712+ "format_animated" ,
713+ "theme_light" ,
714+ "theme_dark" ,
715+ )
705716
706717 def __init__ (self , data : dict ) -> None :
707718 self .id : str = data ["id" ]
@@ -714,7 +725,7 @@ def __init__(self, data: dict) -> None:
714725 self .theme_light : bool = "light" in data ["theme_mode" ]
715726 self .format_static : bool = "static" in data ["format" ]
716727 self .format_animated : bool = "animated" in data ["format" ]
717-
728+
718729 def url_for (self , format : Literal ["static" , "animated" ], theme : Literal ["dark" , "light" ], scale : str ) -> str :
719730 """
720731 Returns a cdn url that can be used to download or serve the emote on a website.
@@ -729,26 +740,26 @@ def url_for(self, format: Literal["static", "animated"], theme: Literal["dark",
729740 scale: :class:`str`
730741 The scale of the emote. This should be formatted in this format: ``"1.0"``.
731742 The scales available for this emote can be checked via :attr:`~.scales`.
732-
743+
733744 Returns
734745 --------
735746 :class:`str`
736747 """
737748 if scale not in self .scales :
738749 raise ValueError (f"scale for this emote must be one of { ', ' .join (self .scales )} , not { scale } " )
739-
750+
740751 if (theme == "dark" and not self .theme_dark ) or (theme == "light" and not self .theme_light ):
741752 raise ValueError (f"theme { theme } is not an available value for this emote" )
742753
743754 if (format == "static" and not self .format_static ) or (format == "animated" and not self .format_animated ):
744755 raise ValueError (f"format { format } is not an available value for this emote" )
745-
756+
746757 return f"https://static-cdn.jtvnw.net/emoticons/v2/{ self .id } /{ format } /{ theme } /{ scale } "
747-
758+
748759 def __repr__ (self ) -> str :
749760 return f"<Emote id={ self .id } name={ self .name } >"
750761
751- def __hash__ (self ) -> int : # this exists so we can do set(list of emotes) to get rid of duplicates
762+ def __hash__ (self ) -> int : # this exists so we can do set(list of emotes) to get rid of duplicates
752763 return hash (self .id )
753764
754765
0 commit comments