Skip to content

Commit f13d9f2

Browse files
authored
Typecast IDs and add __slots__
1 parent da64868 commit f13d9f2

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

discord/raw_models.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -300,12 +300,13 @@ class RawThreadDeleteEvent(_RawReprMixin):
300300
thread: Optional[:class:`discord.Thread`]
301301
The thread that was deleted. This may be ``None`` if deleted thread is not found in internal cache.
302302
"""
303-
303+
__slots__ = ('thread_id', 'thread_type', 'guild_id', 'parent_id', 'thread')
304+
304305
def __init__(self, data: ThreadDeleteEvent) -> None:
305-
self.thread_id: int = data['id']
306-
self.thread_type: ChannelType = try_enum(ChannelType, data['type'])
307-
self.guild_id: int = data['guild_id']
308-
self.parent_id: int = data['parent_id']
306+
self.thread_id: int = int(data['id'])
307+
self.thread_type: ChannelType = try_enum(ChannelType, int(data['type']))
308+
self.guild_id: int = int(data['guild_id'])
309+
self.parent_id: int = int(data['parent_id'])
309310
self.thread: Optional[Thread] = None
310311

311312

0 commit comments

Comments
 (0)