telegram-bot

How to create a link to contact specific phone number via Telegram?

邮差的信 提交于 2020-01-03 15:34:25
问题 So I found out I could use a link like this in HTML: <a href="https://api.whatsapp.com/send?phone={{phone_number}}" target="_blank">WhatsApp</a> in order to let a user contact {{phone_number}} directly from a webpage (via WhatsApp web). My question is: how to do the same but instead of WhatsApp, via Telegram? Thank you in advance 回答1: It's NOT possible to link to Telegram like this for a phone numbers so far, because every user MUST add the phone number to their contact list before they can

How to make Keyboard Button message text different from its caption in Telegram bot API using C#

試著忘記壹切 提交于 2020-01-03 13:08:26
问题 I need my bot to print a different message than its caption (which shows by telegram client on keyboard button element). My custom button has this text: "Where am I?" and when I click on it, it prints on the screen "Where am I?" also. I want the button to print "/location" .(something different from its text field) How can I achieve it? I'm using C# and Telegram Bot API EDIT: What I want: When the user clicks this button, telegram client send a messages with /age [as his typed message] but

How to read content of a Telegram channel posts by post link?

眉间皱痕 提交于 2020-01-03 04:23:05
问题 Telegram channels posts have the post link when it is right clicked on it and in this form: https://telegram.me/channel_name/post_ID The question is how we can read the content of that posts (text, image, video, audio) using a bot on the server? 回答1: There is no way to do this at the moment. You can try using the telegram-cli ( test branch supports channels), but it cannot find the post by its POST_ID — only by the full message id. 来源: https://stackoverflow.com/questions/37888354/how-to-read

How many telegram bots can I create?

[亡魂溺海] 提交于 2020-01-02 03:44:07
问题 tldr: Is there a limit to the number of bots a user can create on telegram? usecase: I'm considering "selling custom bots" to people as a service, and would like to avoid having my clients handle technical stuff like api keys or "talking to botfather". So I would create their bot on my account, but this isn't really doable if I'm limited to a certain number of bots. I didn't find anything in their docs or their faq, but maybe someone here did run into a limit. Thanks! 回答1: You can only create

How do I have my Bot respond with arguments?

旧街凉风 提交于 2020-01-02 01:17:07
问题 So I've built a Telegram bot, which can receive the following commands: /list /info 123 This works great, as I can catch /info and pass the additional arguments as ints. But, sadly, the Telegram clients don't see /info 123 as a complete command, but just the /info part. Is there a way to make it recognize the entirety of the command as the command? I've tried Markdown-ing it: [/info 123](/info 123) , but no joy. Is this possible? 回答1: I've reached out to @BotSupport with the same question,

'stream.ReadTimeout' threw an exception of type 'System.InvalidOperationException' sending photo to telegram bot

青春壹個敷衍的年華 提交于 2019-12-30 06:21:41
问题 I wrote below code for sending a photo to my bot, but in my stream, I have two exceptions for read and write and my photo was not send. I think maybe the reason was this error, but I couldn't fix it: stream.ReadTimeout threw an exception of type 'System.InvalidOperationException' using (var stream = System.IO.File.Open("a.jpg", FileMode.Open)) { var fileToSend = new FileToSend("a.jpg", stream); Task.Run(() => bot.SendPhotoAsync(u.Message.Chat.Id, fileToSend).ConfigureAwait(false)); } 回答1: The

How to receive messages in group chats using telegram bot api

独自空忆成欢 提交于 2019-12-30 02:35:09
问题 My telegram bot receives messages sent by user to my bot in private chats but not receives messages sent by users in group chats. Any options/api for getting group chat messages also,. 回答1: Talk to @botfather and disable the privacy mode. 回答2: Sequence within a BotFather chat: You : /setprivacy BotFather : Choose a bot to change group messages settings. You : @your_name_bot BotFather : 'Enable' - your bot will only receive messages that either start with the '/' symbol or mention the bot by

generate inline keyboard telegram bot from the database

大憨熊 提交于 2019-12-25 17:37:53
问题 hi I have some product cat in my database I want to generate inline keyboard from the theme but I want to like this we have cat1-ca2-ca3-ca4-ca5 I want to like this cat1 cat2 cat3 cat4 cat5 I need the loop for this result thanks 回答1: When you get the values that you want to show in the keyboard, you need to store these in array. This example was did in Javascript, you must found the equivalent in php code. If you only have 5 products you don't need a loop, just: ... { 'reply_markup': JSON

sendMessage to any bot user

 ̄綄美尐妖づ 提交于 2019-12-25 06:33:03
问题 I have a server bot (made with cronjobs and PHP): if a condition is met, the bot sends a mail containing a specific message. I noticed any person receiving the mail message has a Telegram account too. What I want to do is the following: I create a bot and, instead of sending mails, the bot posts the message users generally receive by mail. I tried the following using the command line: curl -s -X POST https://api.telegram.org/botToken/sendMessage -d text=”hello from the bot” -d chat_id=0000000

How do make my bot send message without an update?

末鹿安然 提交于 2019-12-25 03:44:19
问题 i am creating a telegram bot in java bot but i have problem,I have seen bots that send text\ad without an update from a user ,I want to know how i can do it .It is only sending messages when the user sends a message to it.i need to know how can i make my bot send some message without a onUpdateReceived.(sorry for my english) onUpdateReceived(Update update) only sends message when the user sends a command Thank you. 回答1: Just create an instance of Send message. Eg. SendMessage message = new