telegram

telegram bot prefill text for user to edit

左心房为你撑大大i 提交于 2020-06-24 11:44:10
问题 Telegram bot sends me a message with a text snippet, which I want to edit, and send back to the bot for further processing. Copy and paste takes time. Typing message anew takes time. Ideally I'd like to press an inline button "Edit" on the bot's message and get the message text appear in my reply input box for editing.(A message id attached to my reply somehow would be a plus). I tried to use deep linking with parameters other than /start*, but that doesn't seem to work. Can I use bot API (or

How to send photo via Telegram Bot with file path?

穿精又带淫゛_ 提交于 2020-06-17 09:43:29
问题 I am trying to send a photo through my Telegram bot, but am getting an error. I have the file path of the photo on my computer. Maybe I am not putting the file path in correctly. The error I get is: SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape`. Which is referring to right before the path name. This is the code I have: import requests import json bot_token = 'XXXXXX' chat_id = "-100YYYYYY" file = "C:\Users\name\OneDrive

How to correct “ 'coroutine' object has no attribute 'data'” Error when using Telethon for Telegram?

落爺英雄遲暮 提交于 2020-06-17 01:43:11
问题 I am trying to code a simple thing in Python to automatically download some media from a Channel on Telegram. I am using Telethon for this. I keep getting an error that I cannot solve and for which I do not understand the reason. "'coroutine' object has no attribute 'data'" I have tried to use asyncio as well, but it didn't work. Here below my latest code # In[1]: import asyncio loop = asyncio.get_event_loop() import telethon.sync from telethon import TelegramClient from telethon.sync import

How to correct “ 'coroutine' object has no attribute 'data'” Error when using Telethon for Telegram?

不羁岁月 提交于 2020-06-17 01:41:05
问题 I am trying to code a simple thing in Python to automatically download some media from a Channel on Telegram. I am using Telethon for this. I keep getting an error that I cannot solve and for which I do not understand the reason. "'coroutine' object has no attribute 'data'" I have tried to use asyncio as well, but it didn't work. Here below my latest code # In[1]: import asyncio loop = asyncio.get_event_loop() import telethon.sync from telethon import TelegramClient from telethon.sync import

Telegram BotFather API

丶灬走出姿态 提交于 2020-06-12 19:11:13
问题 Is there a way to "communicate" with Telegram BotFather via API to create and configure new bots without actually "chat" with it? It could be useful to create a bot programmatically. 来源: https://stackoverflow.com/questions/49240811/telegram-botfather-api

Telegram BotFather API

匆匆过客 提交于 2020-06-12 19:11:12
问题 Is there a way to "communicate" with Telegram BotFather via API to create and configure new bots without actually "chat" with it? It could be useful to create a bot programmatically. 来源: https://stackoverflow.com/questions/49240811/telegram-botfather-api

How to get channel updates with Telegram robot

爷,独闯天下 提交于 2020-05-29 21:11:56
问题 I have searched over Telegram API and Bot API docs for days and it seems there is no direct way for a robot to get notified when there is a new update in a channel say a News channel, Sports channel, etc. The only thing I came up with was: A hook returns updates for channel only when the robot is an administrator member: { "update_id": 673009340, "message": { "message_id": 160, "from": { "id": 104911111, "is_bot": false, "first_name": "Jason", "username": "jason", "language_code": "en-US" },

How to get channel updates with Telegram robot

孤人 提交于 2020-05-29 21:10:52
问题 I have searched over Telegram API and Bot API docs for days and it seems there is no direct way for a robot to get notified when there is a new update in a channel say a News channel, Sports channel, etc. The only thing I came up with was: A hook returns updates for channel only when the robot is an administrator member: { "update_id": 673009340, "message": { "message_id": 160, "from": { "id": 104911111, "is_bot": false, "first_name": "Jason", "username": "jason", "language_code": "en-US" },

Telegram's instant view API: Element <img> is not supported in <p>

℡╲_俬逩灬. 提交于 2020-05-29 10:14:05
问题 I have problem when trying to create my Telegram's Instant View template, with this error: Element <img> is not supported in <p>: <img src="mysrc" /> So, I decided to replace tag <p> if has <img> tag with <figure> tag @replace_tag(<figure>): $body//p//img But the result is not showing the image. FYI, the <img> doesn't have attributes except src . Sample code: <p><img src="mysrc"/></p> I have no idea, please help me 回答1: The problem with your code is it replaces the <img> . Like what you've

Telegram bot API is the chat_id unique for each user contacting the bot?

回眸只為那壹抹淺笑 提交于 2020-05-29 07:43:52
问题 We are using python API for telegram bots and need to be able to identify the user. Is the chat_id unique for each user connecting the bot? Can we trust the chat_id to be consistent? e.g same chat_id will tell us that this is the same user, and each user connecting with the bot will have one chat_id that is consistent between sessions? Thanks 回答1: Is the chat_id unique for each user connecting the bot? Yes chat_id will always be unique for each user connecting to your bot. If the same user