Javascript 电报机器人|如何使用tg://协议发送URL按钮?
我正在使用node JS(meteor)编写一个电报机器人,这就是我创建带有Javascript 电报机器人|如何使用tg://协议发送URL按钮?,javascript,meteor,telegram,telegram-bot,Javascript,Meteor,Telegram,Telegram Bot,我正在使用node 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(c
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' }]
]
})
});
});
将
添加和连接
替换为添加和连接;连接
如果问题无法解决,请将%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=*' }]
]
})
});
});
为什么被否决?我找不到重复的问题…不,仍然是这个错误:
错误的请求:不支持的URL协议
,如果我在sytnax中有一些错误,它应该抛出语法错误。。。