diff --git a/lib/services.dart b/lib/services.dart index f71a6969..6c80381d 100644 --- a/lib/services.dart +++ b/lib/services.dart @@ -1,6 +1,7 @@ export 'package:mineral/src/infrastructure/internals/cache/cache_provider_contract.dart'; export 'package:mineral/src/infrastructure/internals/environment/env_schema.dart'; export 'package:mineral/src/infrastructure/internals/environment/environment.dart'; +export 'package:mineral/src/infrastructure/internals/marshaller/marshaller.dart'; export 'package:mineral/src/infrastructure/services/http/header.dart'; export 'package:mineral/src/infrastructure/services/http/http_client.dart'; export 'package:mineral/src/infrastructure/services/http/http_client_config.dart'; diff --git a/lib/src/infrastructure/internals/packets/listeners/guild_create_packet.dart b/lib/src/infrastructure/internals/packets/listeners/guild_create_packet.dart index d1f47116..a741ee03 100644 --- a/lib/src/infrastructure/internals/packets/listeners/guild_create_packet.dart +++ b/lib/src/infrastructure/internals/packets/listeners/guild_create_packet.dart @@ -21,6 +21,7 @@ final class GuildCreatePacket implements ListenablePacket { Future listen(ShardMessage message, DispatchEvent dispatch) async { final rawServer = await marshaller.serializers.server.normalize(message.payload); + final server = await marshaller.serializers.server.serialize(rawServer); final bot = ioc.resolve(); diff --git a/lib/src/infrastructure/internals/packets/listeners/guild_role_delete_packet.dart b/lib/src/infrastructure/internals/packets/listeners/guild_role_delete_packet.dart index 72e703d8..16d7b886 100644 --- a/lib/src/infrastructure/internals/packets/listeners/guild_role_delete_packet.dart +++ b/lib/src/infrastructure/internals/packets/listeners/guild_role_delete_packet.dart @@ -19,7 +19,7 @@ final class GuildRoleDeletePacket implements ListenablePacket { final server = await marshaller.dataStore.server .getServer(message.payload['guild_id']); - final roleId = message.payload['role']['id']; + final roleId = message.payload['role_id']; final roleCacheKey = marshaller.cacheKey.serverRole(server.id, roleId); final rawRole = await marshaller.cache.get(roleCacheKey); diff --git a/lib/src/infrastructure/internals/packets/listeners/guild_role_update_packet.dart b/lib/src/infrastructure/internals/packets/listeners/guild_role_update_packet.dart index fb5b01ef..37a13cde 100644 --- a/lib/src/infrastructure/internals/packets/listeners/guild_role_update_packet.dart +++ b/lib/src/infrastructure/internals/packets/listeners/guild_role_update_packet.dart @@ -28,8 +28,10 @@ final class GuildRoleUpdatePacket implements ListenablePacket { ? marshaller.serializers.role.serialize(rawBefore) : null; - final rawRole = - await marshaller.serializers.role.normalize(message.payload['role']); + final rawRole = await marshaller.serializers.role.normalize({ + 'server_id': server.id, + ...message.payload['role'], + }); final role = await marshaller.serializers.role.serialize(rawRole); server.roles.list.update(role.id, (_) => role);