我正在用节点JS (流星)编写一个电报机器人,当我用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' }]
]
})
});
});发布于 2018-04-15 05:20:02
将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=*' }]
]
})
});
});https://stackoverflow.com/questions/49837982
复制相似问题