telegram

How to send telegram mediaGroup with caption/text

痞子三分冷 提交于 2021-02-08 14:59:27
问题 I'm currently using python-telegram-bot and basically what I want to achieve with it is to send telegram messages like this: So the message consists of 2+ photos/videos with text message underneath. What I've already tried: sending message with send_message method, and including photo URLs, but it only shows 1 picture which is under the text sending media group using send_media_group, but this method has no caption parameter as send_photo. 回答1: You should use sendMediaGroup, where you can

error 400 when sending request from python to telegram

放肆的年华 提交于 2021-02-08 11:37:56
问题 I got a 400 error while sending a request from python to telegram. Here is the code: bot_message = message bot_token = 'xxx' bot_chatID = 'xxx' send_text = 'https://api.telegram.org/bot' + bot_token + '/sendMessage?chat_id=' + bot_chatID + '&parse_mode=Markdown&text=' + bot_message response = requests.get(send_text) Here's the message that caused error : sharashahira 2021-01-25 10:37:50 @CIMB_Assists Mana ni kata sampai pkul 4;45pm. Sampai sekaranf error. Boikot cimb clicks app😒 It got "emote

error 400 when sending request from python to telegram

可紊 提交于 2021-02-08 11:36:52
问题 I got a 400 error while sending a request from python to telegram. Here is the code: bot_message = message bot_token = 'xxx' bot_chatID = 'xxx' send_text = 'https://api.telegram.org/bot' + bot_token + '/sendMessage?chat_id=' + bot_chatID + '&parse_mode=Markdown&text=' + bot_message response = requests.get(send_text) Here's the message that caused error : sharashahira 2021-01-25 10:37:50 @CIMB_Assists Mana ni kata sampai pkul 4;45pm. Sampai sekaranf error. Boikot cimb clicks app😒 It got "emote

Python telegram bot: Access to contact information

邮差的信 提交于 2021-02-08 05:08:05
问题 Following code requests location and contact from user: def contact(bot, update): dp = DjangoTelegramBot.dispatcher con_keyboard = KeyboardButton(text="send_contact", request_contact=True) loc_keyboard = KeyboardButton(text="send_location", request_location=True) custom_keyboard = [[ con_keyboard ,loc_keyboard]] reply_markup = ReplyKeyboardMarkup(custom_keyboard) bot.sendMessage(update.message.chat_id, text="Would you mind sharing your location and contact with me", reply_markup=reply_markup)

Python telegram bot: Access to contact information

强颜欢笑 提交于 2021-02-08 05:03:51
问题 Following code requests location and contact from user: def contact(bot, update): dp = DjangoTelegramBot.dispatcher con_keyboard = KeyboardButton(text="send_contact", request_contact=True) loc_keyboard = KeyboardButton(text="send_location", request_location=True) custom_keyboard = [[ con_keyboard ,loc_keyboard]] reply_markup = ReplyKeyboardMarkup(custom_keyboard) bot.sendMessage(update.message.chat_id, text="Would you mind sharing your location and contact with me", reply_markup=reply_markup)

Automate setcommands

核能气质少年 提交于 2021-02-07 10:14:50
问题 Is it possible to automate the setcommands command? I want to register all my commands on startup of the application, so I don't have to do that manually (which kinda sucks during development). Is there a HTTP API or can I send a message to the Botfather from my bot? 回答1: There is not API method to set commands, you have to use the Botfather. 来源: https://stackoverflow.com/questions/37231451/automate-setcommands

Automate setcommands

六月ゝ 毕业季﹏ 提交于 2021-02-07 10:14:21
问题 Is it possible to automate the setcommands command? I want to register all my commands on startup of the application, so I don't have to do that manually (which kinda sucks during development). Is there a HTTP API or can I send a message to the Botfather from my bot? 回答1: There is not API method to set commands, you have to use the Botfather. 来源: https://stackoverflow.com/questions/37231451/automate-setcommands

Telegram Bot SSL Error

二次信任 提交于 2021-02-07 10:06:41
问题 So I have made a small script on my website for my telegram bot. Only problem is that if I set my URL as webhook for the bot it gives an SSL error. Also tried to add an self signed certificate, so has_custom_certificate turned to true, but the same error appeared. What am I doing wrong? 回答1: You have to create a self-signed certificate for deploying your server over https. If you are using flask you can follow this nice tutorial - https://blog.miguelgrinberg.com/post/running-your-flask

How to send large file with Telegram Bot API?

丶灬走出姿态 提交于 2021-02-07 02:58:57
问题 Telegram bot has a file size limit for sending in 50MB. I need to send large files. Is there any way around this? I know about this project https://github.com/pwrtelegram/pwrtelegram but I couldn't make it work. Maybe someone has already solved such a problem? There is an option to implement the file upload via Telegram API and then send by file_id with bot. I write a bot in Java using the library https://github.com/rubenlagus/TelegramBots UPDATE For solve this problem i use telegram api,

Telegram calls via Dante socks5 proxy server not working

橙三吉。 提交于 2021-02-05 20:31:35
问题 I've confugured Dante 1.4on Ubuntu 16.04 as a socks5 proxy for Telegram. Chats are working, but voice calls are not, failing at "Connecting". Is there something special I need to configure in order to proxy Telegram voice traffic? I'm using a single non priveleged (>1024) TCP/UDP port + login + password for connection. Thanks! UPD: Thats piece of log while i am trying to call somebody: Apr 15 23:05:38 (1523736338.510915) danted[22977]: info: pass(1): udp/udpassociate [: username%USER@0.0.0.0