telegram

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,

How Can I get my app id in Telegram API?

筅森魡賤 提交于 2020-01-01 05:21:05
问题 I am trying to get my app id from Telegram API by using the method register.saveDeveloperInfo , but I cannot find the way to do it. I'm using de MTProto Java library. This is what I had done by now: I made my own register.saveDeveloperInfo implemmentation in Java. I call the method with the corrects params (https://core.telegram.org/api/obtaining_api_id) The method returns a true boolean but I have not received the sms with my app_id. When I enter in my app section of the telegram web (https:

Starting a Telegram API instance

痞子三分冷 提交于 2020-01-01 05:00:07
问题 Hi! Telegram API beginner here! I'm developing a PhoneGap app that features a messaging service using the Telegram API. I'm currently following the API guide and I'm now reading the getting started guide for authentication. However, I find that it is currently insufficient and not Jimmy Proof. How does one create a Telegram API instance in one's own app? After initialization how does one authenticate a user? From the link provided, this can be done with the auth.sendCode method. But to what

Proper way to build menus with python-telegram-bot

一笑奈何 提交于 2020-01-01 04:52:29
问题 I work with python-telegram-bot and try to build a system of nested menus as BotFather bot does. For instance, you have a general bot menu where you can choose "Edit Bot" and get the new corresponding menu with an option to get back to the previous menu. I try to achieve that with code: # main menu def start(bot, update): menu_main = [[InlineKeyboardButton('Option 1', callback_data='m1')], [InlineKeyboardButton('Option 2', callback_data='m2')], [InlineKeyboardButton('Option 3', callback_data=

How to receive my own telegram messages in node.js without bot

心已入冬 提交于 2019-12-31 08:48:08
问题 I would like to have a very simple client in nodejs (an example) that can receive messages from my contacts in telegram. I just searched in internet but I only get bot samples. I want to receive group messages in what I don't have access to give privileges to my bot so I would like to know if I can receive my own messages with no bot as intermediary. 回答1: Well... Other answers give examples from unmaintained libraries. Hence, you should not rely on these libraries. See: telegram.link is dead

Add new contact in api telegram python telethon

纵饮孤独 提交于 2019-12-30 19:26:22
问题 How do I save a number in my contacts in telethon python? from telethon import TelegramClient from telethon.tl.functions.contacts import GetContactsRequest from telethon.tl.types import InputPeerUser client = TelegramClient('arta0', api_id, api_hash) client.connect() #number=+19133704541 #name='ali karimi' What module do I need to add contact? 回答1: You can create a contact like this: contact = InputPhoneContact(client_id = 0, phone = "+12345678", first_name="ABC", last_name="abc") result =

'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

Can I store bot state data on the involved telegram chat itself?

无人久伴 提交于 2019-12-25 17:18:21
问题 I'm trying to store a bit of data regarding the bot's conversation within a group (i.e. the bot manages kind of a text-based chat scape room and I want to save which "world" and "stage" the group is in at the time), and so I was wondering whether you can just store this little amount of data within the chat itself (instead of saving it on the bot server side*, which seems quite a lot of work for something that should be so simple). So following this python zen philosophy, I'm trying to find a

Can I store bot state data on the involved telegram chat itself?

血红的双手。 提交于 2019-12-25 17:18:05
问题 I'm trying to store a bit of data regarding the bot's conversation within a group (i.e. the bot manages kind of a text-based chat scape room and I want to save which "world" and "stage" the group is in at the time), and so I was wondering whether you can just store this little amount of data within the chat itself (instead of saving it on the bot server side*, which seems quite a lot of work for something that should be so simple). So following this python zen philosophy, I'm trying to find a

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