telethon

Hosting a Telethon User BOT on google-app-engine

ε祈祈猫儿з 提交于 2021-02-11 14:48:10
问题 I am trying to deploy a simple user bot on Google App Engine Flexible Environment running python3.7, but I get the following error. Can anyone help me with suggestions of solving this? "File "/env/lib/python3.7/site-packages/telethon/client/auth.py", line 20, in phone: typing.Callable[[], str] = lambda: input('Please enter your phone (or bot token): '), EOFError: EOF when reading a line" Thank you for your time 回答1: Telethon (obviously) requires you to login and make a normal user session on

async with" if the event loop is running

强颜欢笑 提交于 2021-02-08 06:51:05
问题 I'm writing my first telegram bot with telepot and telethon my main code is: import sys import asyncio import random import telepot import telepot.aio from telepot.aio.loop import MessageLoop from telepot.namedtuple import ReplyKeyboardMarkup, KeyboardButton, ReplyKeyboardRemove, ForceReply from telepot.namedtuple import InlineKeyboardMarkup, InlineKeyboardButton from telepot.namedtuple import InlineQueryResultArticle, InlineQueryResultPhoto, InputTextMessageContent async def on_chat_message

async with" if the event loop is running

那年仲夏 提交于 2021-02-08 06:50:46
问题 I'm writing my first telegram bot with telepot and telethon my main code is: import sys import asyncio import random import telepot import telepot.aio from telepot.aio.loop import MessageLoop from telepot.namedtuple import ReplyKeyboardMarkup, KeyboardButton, ReplyKeyboardRemove, ForceReply from telepot.namedtuple import InlineKeyboardMarkup, InlineKeyboardButton from telepot.namedtuple import InlineQueryResultArticle, InlineQueryResultPhoto, InputTextMessageContent async def on_chat_message

How to correctly use the iter_download functionality for multi connection downloads in Telethon

邮差的信 提交于 2021-01-21 10:55:08
问题 I've been trying to implement a multi threaded Telegram download client. For single downloads we can simply use the download_media functionality. But telethon offers iter_download function, as per documenation it is used for streaming which also includes pausing and resuming functionality. We can use this to download a single file with multiple connections. This is what I've scripted so far. No where to find any solid examples for multi connection download async def multi_downloader(file,

How to migrate ConversationHandler module from Python-Telegram-Bot to Telethon

流过昼夜 提交于 2021-01-01 04:23:32
问题 Python-telegram-bot which is HTTP Telegram Bot API wrapper has telegram.ext.ConversationHandler module and its functionality is: "A handler to hold a conversation with a single user by managing four collections of other handlers." I'm migrating from this python-telegram-bot to Telethon MTProto API . And I have this ConversationHandler to manage conversation. How can I create any type of ConversationHandler in Telethon . Here is some little overview given by Telethon to migrate from python

How to migrate ConversationHandler module from Python-Telegram-Bot to Telethon

六月ゝ 毕业季﹏ 提交于 2021-01-01 04:23:31
问题 Python-telegram-bot which is HTTP Telegram Bot API wrapper has telegram.ext.ConversationHandler module and its functionality is: "A handler to hold a conversation with a single user by managing four collections of other handlers." I'm migrating from this python-telegram-bot to Telethon MTProto API . And I have this ConversationHandler to manage conversation. How can I create any type of ConversationHandler in Telethon . Here is some little overview given by Telethon to migrate from python

Trying to stream telegram media and playing it in a web page

安稳与你 提交于 2020-12-05 11:52:07
问题 I am trying to stream Telegram video files and play them on a web page. I am using this script to stream Telegram videos to a web server. It uses Telethon and AIOhttp to stream the file. The streaming part can be seen here. I am currently serving it on a server to serve media files. The videos can be downloaded using the link the script provides and can be streamed on any media player. But when I try to stream them on a web page, it has problems. For mp4 videos, Chrome does not play them