telegram-bot

How to create InlineKeyboardMarkup this example?

偶尔善良 提交于 2019-12-10 11:49:55
问题 I want to create a Button that when Click on button user go to the group telegram. but cann`t using NetTelegramBotApi; // last verion class Program { private static string Token = "......"; // private static InlineKeyboardMarkup Menu1; } public static async Task RunBot() { // var keyboardInlineMenu = new InlineKeyboardButton[20][]; ..... ..... .... .... if (text == "/start") { // keyboardInlineMenu = new InlineKeyboardButton () { InlineKeyboardButton[][] buttons = new InlineKeyboardButton[2][

Why telegram does not send the updates after setting webhook?

限于喜欢 提交于 2019-12-10 11:14:18
问题 I can get the updates with Telegram getUpdates API, while after setting webhook with a valid SSL certificate or self-signed certificate it says: {"ok":true,"result":true,"description":"Webhook was set"} But it does not send any updates to my webhook link (I checked the Nginx and node.js access log files), I tried a lot of curl commands for setWebhook API with and without certificate, but still no result: curl -s -X POST https://api.telegram.org/bot<TOKEN>/setWebhook -d url='https://www

How can I redirect messages from telegram channels that are in certain format?[telegram bot]

浪尽此生 提交于 2019-12-10 00:30:40
问题 I have many telegram channels, 24\7 they send messages in the format "buy usdjpy sl 145.2 tp 167.4" "eurusd sell sl 145.2 tp 167.4" "eurusd sl 145.2 tp 167.4 SELL" or these words in some order My idea is to create app that checks every channel's message, and redirects it to my channel if it is in the above format. Does telegram api allow it? 回答1: I solved a similar problem with TdLib. Their GitHub site has full C++, Java and C# examples that you can just modify. I worked on the Java example,

Anyway for setting Telegram Webhook without setting up https connection

守給你的承諾、 提交于 2019-12-09 12:24:46
问题 I want to setup Telegram Webhook but I don't have https URL, I don't want to deal with ssl certificates either. Can I solve this problem by using https URL or without setting https certificate up? Telegram webhook desc: https://core.telegram.org/bots/api#setwebhook 回答1: https is mandatory but it doesn't mean you MUST set it up completely. You can use more more simple ways, let me explain: You can connect your localhost server on your own PC or mac or linux machine, to telegram severs without

Can i get a phone number by user id via Telegram Bot API?

北城以北 提交于 2019-12-09 09:03:39
问题 I'm using Telegram Bot API for sending instant messages to users. I've installed nuget package. This package is recommend by telegram developers. I've created a telegram bot and successfully got access to it by using code. When I send messsage to bot, bot gets some info about sender. I need the phone numbers of users to identify them in our system and send the information back to them. My question is Can i get a user phone number by telegramUserId ? I'm doing it for user convenience. If i

Telegram bot weird error : Bad Request: wrong file identifier/HTTP URL specified

倖福魔咒の 提交于 2019-12-09 02:28:12
问题 I am sending message to telegram channel using bot. With using webhook method. I'm sending file_id via the link. I got the file_id from a channel post. For some files like GIF & video format (MP4), when i use this code: $url = 'https://api.telegram.org/bot'.token.'/sendVideo?chat_id='.uid."&video=".$file."&caption=" .urlencode($caption); file_get_contents($url); i get such this error : {"ok":false,"error_code":400,"description":"Bad Request: wrong file identifier/HTTP URL specified"} I really

Telegram bot API: Can I mix a custom keyboard and a force_reply?

a 夏天 提交于 2019-12-08 17:33:59
问题 I have a custom keyboard but to process the answer i need a force reply so i get the question back in the next message. I have done this: var opts = { reply_markup: JSON.stringify({ keyboard: [['OK','Cancel']], one_time_keyboard: true, resize_keyboard: true, force_reply: true }) }; The keyboard works but not the force_reply. Force reply on its own works? Can i not use it in combination with a custom keyboard? 回答1: It may be late to help you, but here it goes. Currently only one reply_markup

Telegram Bot API error when try to edit message: “Bad Request: message not found”

末鹿安然 提交于 2019-12-08 15:19:04
问题 I've tried to edit bot's message which was sended about 2 hours ago and got this error and supposed that this message so old for editing that it is unable. Then I've tried to edit another message which was sended a little later and it was successful. But after this I've tried to edit one of recently sended messages an got this error one more time. Now it seems like request's results is random. What does it mean? Here an example of my POST query: https://api.telegram.org/bot{token}

Can a Telegram bot read messages of channel

风格不统一 提交于 2019-12-08 14:39:40
问题 Can a telegram bot read/access a telegram channel that neither I or the bot is administrator of? I know that up to last November it was not possible, but I have heard some people have done this, but so far I am not able to do it. I would really appreciate your input and knowledge. P.s. any workaround would be great. 回答1: The FAQ reads: All bots, regardless of settings, will receive: All service messages. All messages from private chats with users. All messages from channels where they are a

Telegram bot to wait for user reply

久未见 提交于 2019-12-08 01:44:55
问题 The code below is for a Telegram Bot which basically takes a person username and password and verifies it to provide his average expenditures. The problem as we see is the bot waits for the user to send his username and password for 10 sec either waste of time (or) not sufficient time was given. How could I program such that the bot waits for user message and then executes the next lines ( wait till the trigger ) def highest(intent,chatid,text): seq=["What is your Username ?","Password?"]