|
6 | 6 | from interactions.client.utils.attr_converters import optional |
7 | 7 | from interactions.client.utils.serializer import to_image_data |
8 | 8 | from interactions.models.discord.asset import Asset |
9 | | -from interactions.models.discord.emoji import PartialEmoji |
| 9 | +from interactions.models.discord.emoji import CustomEmoji |
10 | 10 | from interactions.models.discord.enums import ApplicationFlags |
11 | 11 | from interactions.models.discord.file import UPLOADABLE_TYPE |
12 | 12 | from interactions.models.discord.snowflake import Snowflake_Type, to_snowflake |
@@ -92,34 +92,34 @@ def owner(self) -> "User": |
92 | 92 | """The user object for the owner of this application""" |
93 | 93 | return self._client.cache.get_user(self.owner_id) |
94 | 94 |
|
95 | | - async def fetch_all_emoji(self) -> List[PartialEmoji]: |
| 95 | + async def fetch_all_emoji(self) -> List[CustomEmoji]: |
96 | 96 | """Fetch all emojis for this application""" |
97 | | - response = await self._client.http.get_application_emojis(self.id) |
98 | | - return [self._client.cache.place_emoji_data(None, emoji) for emoji in response] |
| 97 | + response = await self.client.http.get_application_emojis(self.id) |
| 98 | + return [self.client.cache.place_emoji_data(None, emoji) for emoji in response] |
99 | 99 |
|
100 | | - async def fetch_emoji(self, emoji_id: Snowflake_Type) -> PartialEmoji: |
| 100 | + async def fetch_emoji(self, emoji_id: Snowflake_Type) -> CustomEmoji: |
101 | 101 | """Fetch an emoji for this application""" |
102 | | - response = await self._client.http.get_application_emoji(self.id, emoji_id) |
103 | | - return await self._client.cache.place_emoji_data(None, response) |
| 102 | + response = await self.client.http.get_application_emoji(self.id, emoji_id) |
| 103 | + return self.client.cache.place_emoji_data(None, response) |
104 | 104 |
|
105 | | - async def create_emoji(self, name: str, imagefile: UPLOADABLE_TYPE) -> PartialEmoji: |
| 105 | + async def create_emoji(self, name: str, imagefile: UPLOADABLE_TYPE) -> CustomEmoji: |
106 | 106 | """Create an emoji for this application""" |
107 | 107 | data_payload = { |
108 | 108 | "name": name, |
109 | 109 | "image": to_image_data(imagefile), |
110 | 110 | "roles": MISSING, |
111 | 111 | } |
112 | 112 |
|
113 | | - return self._client.cache.place_emoji_data( |
114 | | - None, await self._client.http.create_application_emoji(data_payload, self.id) |
| 113 | + return self.client.cache.place_emoji_data( |
| 114 | + None, await self.client.http.create_application_emoji(data_payload, self.id) |
115 | 115 | ) |
116 | 116 |
|
117 | | - async def edit_emoji(self, emoji_id: Snowflake_Type, name: str) -> PartialEmoji: |
| 117 | + async def edit_emoji(self, emoji_id: Snowflake_Type, name: str) -> CustomEmoji: |
118 | 118 | """Edit an emoji for this application""" |
119 | | - return await self._client.cache.place_emoji_data( |
120 | | - None, self._client.http.edit_application_emoji(self.id, emoji_id, name) |
| 119 | + return self.client.cache.place_emoji_data( |
| 120 | + None, await self.client.http.edit_application_emoji(self.id, emoji_id, name) |
121 | 121 | ) |
122 | 122 |
|
123 | 123 | async def delete_emoji(self, emoji_id: Snowflake_Type) -> None: |
124 | 124 | """Delete an emoji for this application""" |
125 | | - return await self._client.http.delete_application_emoji(self.id, emoji_id) |
| 125 | + await self.client.http.delete_application_emoji(self.id, emoji_id) |
0 commit comments