From a7a60e433b5272abedfb05e064334b2365de0591 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Tue, 18 Oct 2016 01:28:34 -0400 Subject: Make roles and guilds stateful. --- discord/state.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'discord/state.py') diff --git a/discord/state.py b/discord/state.py index 4aa8d838..0cf0e955 100644 --- a/discord/state.py +++ b/discord/state.py @@ -589,7 +589,7 @@ class ConnectionState: def parse_guild_role_delete(self, data): guild = self._get_guild(int(data['guild_id'])) if guild is not None: - role_id = data.get('role_id') + role_id = int(data['role_id']) role = utils.find(lambda r: r.id == role_id, guild.roles) try: guild._remove_role(role) @@ -602,7 +602,7 @@ class ConnectionState: guild = self._get_guild(int(data['guild_id'])) if guild is not None: role_data = data['role'] - role_id = role_data['id'] + role_id = int(role_data['id']) role = utils.find(lambda r: r.id == role_id, guild.roles) if role is not None: old_role = copy.copy(role) -- cgit v1.2.3