[英]Telegram bot | How to send an URL button with the tg: // protocol?
我正在使用節點JS(meteor)寫一個電報機器人,這就是我用tg://protocol
創建url按鈕時發生的情況,它給出了一個錯誤:
Error in polling: Error: failed [400] {"ok":false,"error_code":400,"description":"Bad Request: unsupported URL protocol"}
這是我的代碼:
TelegramBot.addListener('/button', function(command, username, original) {
TelegramBot.method('sendMessage', {
chat_id: original.chat.id,
text: 'Here is you proxy!',
parse_mode: "HTML",
reply_markup: JSON.stringify({
inline_keyboard: [
[{ text: 'Add & Connect', url: 'tg://resolve?domain=socks%26server=185.211.245.136%26port=1080%26user=106402828%26pass=jr5udGLf' }]
]
})
});
});
將Add & Connect
替換為Add & Connect
Add & Connect
如果問題仍無法解決,請用&
替換%26
我也為您提供使用常規https
協議的方法:
TelegramBot.addListener('/button', function(command, username, original) {
TelegramBot.method('sendMessage', {
chat_id: original.chat.id,
text: 'Here is you proxy!',
parse_mode: "HTML",
reply_markup: JSON.stringify({
inline_keyboard: [
[{ text: 'Add & Connect', url: 'https://t.me/socks?server=*&port=*&user=*&pass=*' }]
]
})
});
});
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.