11from .client import BASE_URL
22
3- def large (id : int ) -> str :
3+ import enum
4+
5+
6+ class WidgetType (enum .Enum ):
7+ """
8+ Widget type.
9+ """
10+
11+ DISCORD_BOT = 'discord/bot'
12+ DISCORD_SERVER = 'discord/server'
13+
14+
15+ def large (type : WidgetType , id : int ) -> str :
416 """
517 Generates a large widget URL.
618
19+ :param type: The widget type.
20+ :type type: :class:`.WidgetType`
21+ :param id: The requested ID.
22+ :type id: :py:class:`int`
23+
24+ :returns: The widget URL.
25+ :rtype: :py:class:`str`
26+ """
27+
28+ return f'{ BASE_URL } /widgets/large/{ type .value } /{ id } '
29+
30+
31+ def votes (type : WidgetType , id : int ) -> str :
32+ """
33+ Generates a small widget URL for displaying votes.
34+
35+ :param type: The widget type.
36+ :type type: :class:`.WidgetType`
37+ :param id: The requested ID.
38+ :type id: :py:class:`int`
39+
40+ :returns: The widget URL.
41+ :rtype: :py:class:`str`
42+ """
43+
44+ return f'{ BASE_URL } /widgets/small/votes/{ type .value } /{ id } '
45+
46+
47+ def owner (type : WidgetType , id : int ) -> str :
48+ """
49+ Generates a small widget URL for displaying an entity's owner.
50+
51+ :param type: The widget type.
52+ :type type: :class:`.WidgetType`
53+ :param id: The requested ID.
54+ :type id: :py:class:`int`
55+
56+ :returns: The widget URL.
57+ :rtype: :py:class:`str`
58+ """
59+
60+ return f'{ BASE_URL } /widgets/small/owner/{ type .value } /{ id } '
61+
62+
63+ def social (type : WidgetType , id : int ) -> str :
64+ """
65+ Generates a small widget URL for displaying social stats.
66+
67+ :param type: The widget type.
68+ :type type: :class:`.WidgetType`
769 :param id: The requested ID.
870 :type id: :py:class:`int`
971
1072 :returns: The widget URL.
1173 :rtype: :py:class:`str`
1274 """
1375
14- return f'{ BASE_URL } /widgets/large /{ id } '
76+ return f'{ BASE_URL } /widgets/small/social/ { type . value } /{ id } '
0 commit comments