telegram-bot

How can I get a list of all bots registered with BotFather?

北城以北 提交于 2020-06-28 03:41:40
问题 My task is to get a list of all user bots, after authorization in the telegram client through the API. I looked in the documentation for a specific method, but did not find it. Can someone tell me how this can be done, and is it possible at all? 回答1: I don't think there's a direct API for that unfortunately. But consider automating the interaction with the BotFather to gather the list programmatically. Here is a sample script in Telethon from telethon import TelegramClient, events API_ID = ..

Telegram authorization without default button

梦想与她 提交于 2020-06-27 07:14:29
问题 The only documented way to use Telegram 3-rd party authorization is to use their script that is being provided at https://core.telegram.org/widgets/login This script (as I digged) works in pretty strange way It renders "Log in with Telegram" button inside the iframe with another extra script that loads some Telegram entities to work with (like TWidgetLogin , TSticker (?) , TVideo (??) , TAudio (???) and some others). By clicking on button, this iframe opens new window that is performing

Telegram authorization without default button

Deadly 提交于 2020-06-27 07:14:07
问题 The only documented way to use Telegram 3-rd party authorization is to use their script that is being provided at https://core.telegram.org/widgets/login This script (as I digged) works in pretty strange way It renders "Log in with Telegram" button inside the iframe with another extra script that loads some Telegram entities to work with (like TWidgetLogin , TSticker (?) , TVideo (??) , TAudio (???) and some others). By clicking on button, this iframe opens new window that is performing

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

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

Image Processing Error, “not enough values to unpack”

*爱你&永不变心* 提交于 2020-06-01 07:40:29
问题 The main problem was described by the post earlier. This is a sequel with full code and traceback. I have a certain error while processing photos using the telegram bot. In particular, this is a problem with a change in contrast. Full code: import telebot import os import urllib.request from PIL import Image import numpy as np TOKEN = 'here token is, just cut it out' bot = telebot.TeleBot(TOKEN) result_storage_path = 'temp' @bot.message_handler(commands=['start']) def start_message(message):

telegram bot with cron and PHP script

浪子不回头ぞ 提交于 2020-05-31 05:41:34
问题 on EC2 I have a crontab like that * * * * * /usr/bin/php /opt/bitnami/apache2/htdocs/bot.php The bot.php file 1 <?php 2 3 exec( 'touch /opt/bitnami/apache2/htdocs/testCron.txt'); 4 5 $botToken="xxxxxxxxxxxxx"; 6 7 $website="https://api.telegram.org/bot".$botToken; 8 $chatId=123456; 9 $params=[ 10 'chat_id'=>$chatId, 11 'text'=>'test bitnami', 12 ]; 13 $ch = curl_init($website . '/sendMessage'); 14 curl_setopt($ch, CURLOPT_HEADER, false); 15 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 16 curl

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" },