mirror of
https://github.com/danog/telegram-tt.git
synced 2024-12-12 00:59:52 +01:00
Bots: Support opening URLs from bot responses
This commit is contained in:
parent
3f540296e7
commit
d76c948b06
@ -243,7 +243,7 @@ async function searchInlineBot({
|
||||
chatId,
|
||||
query,
|
||||
offset,
|
||||
} : {
|
||||
}: {
|
||||
username: string;
|
||||
inlineBotData: InlineBotSettings;
|
||||
chatId: number;
|
||||
@ -313,15 +313,18 @@ async function answerCallbackButton(chat: ApiChat, messageId: number, data: stri
|
||||
data,
|
||||
});
|
||||
|
||||
if (!result || !result.message) {
|
||||
if (!result) {
|
||||
return;
|
||||
}
|
||||
|
||||
const { message, alert: isError } = result;
|
||||
const { showDialog, showNotification, toggleSafeLinkModal } = getDispatch();
|
||||
const { message, alert: isError, url } = result;
|
||||
|
||||
if (isError) {
|
||||
getDispatch().showDialog({ data: { message } });
|
||||
} else {
|
||||
getDispatch().showNotification({ message });
|
||||
showDialog({ data: { message: message || 'Error' } });
|
||||
} else if (message) {
|
||||
showNotification({ message });
|
||||
} else if (url) {
|
||||
toggleSafeLinkModal({ url });
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user