addReaction method
- BaseMessage message,
- String key
Adds Reaction
.
Implementation
Future<ReactionEvent> addReaction(BaseMessage message, String key) async {
sbLog.i(StackTrace.current, 'messageId: ${message.messageId}, key: $key');
checkUnsupportedAction();
if (message.channelUrl != channelUrl) {
throw InvalidParameterException();
}
if (key.isEmpty) {
throw InvalidParameterException();
}
final res = await chat.apiClient.send<ReactionEvent>(
ChannelReactionAddRequest(
chat,
channelType: message.channelType,
channelUrl: message.channelUrl,
messageId: message.messageId,
key: key,
),
);
res.messageId = message.messageId;
return res;
}