telegram-bot

Singing in TelegramClient telethon

混江龙づ霸主 提交于 2021-01-29 06:08:25
问题 After running the code, I try to enter a password (but I don’t have it) and can’t enter anything. I use VS Code Please enter your phone (or bot token): 79622222693 Please enter the code you received: 40589 Please enter your password: (CANT ENTER ANYTHING, AND I DON'T HAVE ANY PASS ON MY ACCOUNT) Tried different accounts. from telethon import TelegramClient, sync api_id = 973111111111145 api_hash = '05c6f86e67922222222222225ad7615a8' client = TelegramClient('sessi1onname', api_id, api_hash)

Telegram bot api not able to restrict user for 24 hours

你离开我真会死。 提交于 2021-01-29 05:58:39
问题 Looking for solution to restrict chat member with restrictChatMember() but unfortunately it still restrict the user forever not for 24 hours. const { date:joinDate } = ctx.message; const releaseDate = moment.unix(joinDate).add(1, 'day'); ctx.telegram.restrictChatMember( ctx.chat.id, memberID, releaseDate, false, false, false, false ); Reference: https://core.telegram.org/bots/api#restrictchatmember 回答1: You're passing a moment object back into the function, not an UNIX timestamp like the docs

Telegram Bot API File Download Path Returns 404

吃可爱长大的小学妹 提交于 2021-01-28 07:22:25
问题 I am currently working on a Telegram Bot project which requires me to download Images send by users to the bot. I followed the API documentation which says to use the getFile call to access the file_path. The file should then be found using the path (https://api.telegram.org/file/bot/) Everything works until I try to access the file using the address above. It always returns 404. However not a json containing the 404 message, but a black screen in the browser and 404 in the page response.

python telegram bot(Telepot) group chat

故事扮演 提交于 2021-01-27 21:54:38
问题 I'm making telegram bot using telepot. The group chat message work a handler when it started with '/'. Is there a way to get all group chat message? 回答1: there are 2 ways to get all the messages of a group: 1.your bot should be added as an admin in that group. disable privacy mode in settings of your bot via @botfather(it is enabled as default(except for bots that are added as admin)) 回答2: Bots have a privacy setting that stops them from reading everything that is sent in a group. You can

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,

Telegram webhook: Why i get ssl3_get_server_certificate:certificate verify failed Error when i call GetWebhookInfo API command?

别等时光非礼了梦想. 提交于 2021-01-08 15:36:15
问题 Server: Win Server 2012 Web server: IIS 8.5 Project: Asp.Net MVC I bought a wildcard SSL certification for my domain and its subdomains and installed it on my server and bound to the website (in IIS). It show green secure HTTPS in browser. I used Telegram SetWebhook with my webhook URL (Something like this: https://webhook.example.com/api/WebhookAction/ ) But when i run Telegram GetWebhookInfo it return certificate verify failed error: { "ok":true, "result":{ "url":"https://webhook.example

Telegram webhook: Why i get ssl3_get_server_certificate:certificate verify failed Error when i call GetWebhookInfo API command?

纵饮孤独 提交于 2021-01-08 15:35:50
问题 Server: Win Server 2012 Web server: IIS 8.5 Project: Asp.Net MVC I bought a wildcard SSL certification for my domain and its subdomains and installed it on my server and bound to the website (in IIS). It show green secure HTTPS in browser. I used Telegram SetWebhook with my webhook URL (Something like this: https://webhook.example.com/api/WebhookAction/ ) But when i run Telegram GetWebhookInfo it return certificate verify failed error: { "ok":true, "result":{ "url":"https://webhook.example

Telegram bot only allowed to post upon events?

≯℡__Kan透↙ 提交于 2021-01-05 12:48:36
问题 It seems like Telegram bot revolves around the idea of reacting to human events (whether in channel or private messages). Is there any way to have the Telegram bot post on a channel independently? Am I really forced to use webhooks for this? I would like my bot to read blockchain operations and post these on my particular channel regardless of human events. 回答1: You can use polling (instead webhook) in the Python Telegram Bot framework updater = Updater('token', use_context=True) dp = updater

Telegram bot only allowed to post upon events?

核能气质少年 提交于 2021-01-05 12:47:48
问题 It seems like Telegram bot revolves around the idea of reacting to human events (whether in channel or private messages). Is there any way to have the Telegram bot post on a channel independently? Am I really forced to use webhooks for this? I would like my bot to read blockchain operations and post these on my particular channel regardless of human events. 回答1: You can use polling (instead webhook) in the Python Telegram Bot framework updater = Updater('token', use_context=True) dp = updater

I'm writing a telegram bot with python

杀马特。学长 韩版系。学妹 提交于 2021-01-05 12:27:38
问题 I want to write a telegram bot via Python, but it doesn't work. import telebot bot = telebot.TeleBot("my_token") @bot.message_handler(content_types=['text']) def sending(message): bot.send_message(message.chat.id, message.text) # RUN bot.polling(non_stop=True) Returns to me the following problem. AttributeError: 'TeleBot' object has no attribute 'message_handler' 回答1: This is a common issue, unfortunately. I guess you installed the lib as "pip install telebot", which leads to another package.