feat(channels): inline-кнопки под постами в каналах
This commit is contained in:
@@ -333,6 +333,8 @@ class ReplyInfo {
|
||||
return 'Ссылка';
|
||||
case AttachmentType.control:
|
||||
return '';
|
||||
case AttachmentType.inlineKeyboard:
|
||||
return '';
|
||||
}
|
||||
}
|
||||
return '';
|
||||
@@ -871,6 +873,28 @@ class MessagesModule {
|
||||
return response.isOk;
|
||||
}
|
||||
|
||||
Future<Map<String, dynamic>?> sendButtonCallback({
|
||||
required int chatId,
|
||||
required String messageId,
|
||||
required String callbackId,
|
||||
String? payload,
|
||||
}) async {
|
||||
final mid = int.tryParse(messageId);
|
||||
if (mid == null) return null;
|
||||
|
||||
final request = {
|
||||
'chatId': chatId,
|
||||
'messageId': mid,
|
||||
'callbackId': callbackId,
|
||||
'payload': ?payload,
|
||||
};
|
||||
|
||||
final response = await _api.sendRequest(Opcode.msgSendCallback, request);
|
||||
if (!response.isOk) return null;
|
||||
final data = response.payload;
|
||||
return data is Map ? Map<String, dynamic>.from(data) : null;
|
||||
}
|
||||
|
||||
Future<TranscriptionResult> requestTranscription(
|
||||
int chatId,
|
||||
int messageId,
|
||||
|
||||
@@ -24,12 +24,18 @@ class WebAppModule {
|
||||
|
||||
WebAppModule(this._api);
|
||||
|
||||
Future<WebAppLaunch> fetchLaunch(int botId) async {
|
||||
Future<WebAppLaunch> fetchLaunch(
|
||||
int botId, {
|
||||
String? startParam,
|
||||
int? chatId,
|
||||
}) async {
|
||||
if (_api.state != SessionState.online) {
|
||||
throw const WebAppUnavailable('Нет соединения с сервером');
|
||||
}
|
||||
final packet = await _api.sendRequest(Opcode.webAppInitData, {
|
||||
'botId': botId,
|
||||
'startParam': ?startParam,
|
||||
'chatId': ?chatId,
|
||||
});
|
||||
if (!packet.isOk) {
|
||||
throw const WebAppUnavailable('Не удалось открыть мини-приложение');
|
||||
|
||||
Reference in New Issue
Block a user