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,
|
chatId,
|
||||||
query,
|
query,
|
||||||
offset,
|
offset,
|
||||||
} : {
|
}: {
|
||||||
username: string;
|
username: string;
|
||||||
inlineBotData: InlineBotSettings;
|
inlineBotData: InlineBotSettings;
|
||||||
chatId: number;
|
chatId: number;
|
||||||
@ -313,15 +313,18 @@ async function answerCallbackButton(chat: ApiChat, messageId: number, data: stri
|
|||||||
data,
|
data,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!result || !result.message) {
|
if (!result) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const { message, alert: isError } = result;
|
const { showDialog, showNotification, toggleSafeLinkModal } = getDispatch();
|
||||||
|
const { message, alert: isError, url } = result;
|
||||||
|
|
||||||
if (isError) {
|
if (isError) {
|
||||||
getDispatch().showDialog({ data: { message } });
|
showDialog({ data: { message: message || 'Error' } });
|
||||||
} else {
|
} else if (message) {
|
||||||
getDispatch().showNotification({ message });
|
showNotification({ message });
|
||||||
|
} else if (url) {
|
||||||
|
toggleSafeLinkModal({ url });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user