diff --git a/lib/src/http/managers/message_manager.dart b/lib/src/http/managers/message_manager.dart index 3099bd190..ca9ab46c9 100644 --- a/lib/src/http/managers/message_manager.dart +++ b/lib/src/http/managers/message_manager.dart @@ -54,7 +54,7 @@ class MessageManager extends Manager { isTts: raw['tts'] as bool, mentionsEveryone: raw['mention_everyone'] as bool, mentions: parseMany(raw['mentions'] as List, client.users.parse), - roleMentions: parseMany(raw['mention_roles'] as List, client.guilds[Snowflake.zero].roles.parse), + roleMentionIds: parseMany(raw['mention_roles'] as List, Snowflake.parse), channelMentions: maybeParseMany(raw['mention_channels'], parseChannelMention) ?? [], attachments: parseMany(raw['attachments'] as List, parseAttachment), embeds: parseMany(raw['embeds'] as List, parseEmbed), diff --git a/lib/src/models/message/message.dart b/lib/src/models/message/message.dart index d230d9817..ab55173eb 100644 --- a/lib/src/models/message/message.dart +++ b/lib/src/models/message/message.dart @@ -15,7 +15,6 @@ import 'package:nyxx/src/models/message/reference.dart'; import 'package:nyxx/src/models/message/reaction.dart'; import 'package:nyxx/src/models/channel/text_channel.dart'; import 'package:nyxx/src/models/message/role_subscription_data.dart'; -import 'package:nyxx/src/models/role.dart'; import 'package:nyxx/src/models/snowflake.dart'; import 'package:nyxx/src/models/snowflake_entity/snowflake_entity.dart'; import 'package:nyxx/src/models/sticker/sticker.dart'; @@ -113,7 +112,7 @@ class Message extends PartialMessage { /// A list of users specifically mentioned in this message. final List mentions; - final List roleMentions; + final List roleMentionIds; /// A list of channels specifically mentioned in this message. final List channelMentions; @@ -194,7 +193,7 @@ class Message extends PartialMessage { required this.isTts, required this.mentionsEveryone, required this.mentions, - required this.roleMentions, + required this.roleMentionIds, required this.channelMentions, required this.attachments, required this.embeds, @@ -219,6 +218,8 @@ class Message extends PartialMessage { /// The webhook that sent this message if it was sent by a webhook, `null` otherwise. PartialWebhook? get webhook => webhookId == null ? null : manager.client.webhooks[webhookId!]; + + // Cannot provide roleMentions as we do not have access to the guild. } /// The type of a message. diff --git a/pubspec.yaml b/pubspec.yaml index d720d429f..1d2279490 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -23,5 +23,5 @@ dev_dependencies: test: ^1.22.0 lints: ^2.0.0 nock: ^1.2.1 - mocktail: ^0.3.0 + mocktail: ^1.0.0 matcher: ^0.12.16