Implementation
static Command buildFileMessage({
required String channelUrl,
required FileMessageParams params,
required String? requestId,
List<dynamic>? thumbnails,
bool? requireAuth,
}) {
final payload = <String, dynamic>{
'channel_url': channelUrl,
'require_auth': requireAuth,
};
payload.addAll(params.toJson());
payload['thumbnails'] = thumbnails;
payload['created_at'] = DateTime.now().millisecondsSinceEpoch;
payload.removeWhere((key, value) => value == null);
return Command(
cmd: CommandString.fileMessage,
payload: payload,
requestId: requestId,
);
}