buildUserMessage static method
Implementation
static Command buildUserMessage(
String channelUrl,
UserMessageParams params,
String requestId,
) {
List<String>? mentionedUserList;
if (params.mentionedUsers != null) {
mentionedUserList = params.mentionedUsers!.map((e) => e.userId).toList();
}
final payload = <String, dynamic>{
'channel_url': channelUrl,
'created_at': DateTime.now().millisecondsSinceEpoch,
'mentioned_user_ids': params.mentionedUserIds ?? mentionedUserList,
};
payload.addAll(params.toJson());
return Command(
cmd: CommandString.userMessage,
payload: payload,
requestId: requestId,
);
}