Pyrogram 在 Pytelegrambotapi 处理程序中不起作用

问题描述

一个处理程序用于处理电报机器人的消息。在特定条件下,Pyrogram 方法应该运行

# coding: utf8
import telebot
from pyrogram import *
import time
bot   = telebot.TeleBot('BottOKEN')

@bot.message_handler(content_types=['text'])
def mes_handler(message):
    if message.text == 'Test123':
        app = Client('my_account')
        print(1)
        with app:
            print(2)
            users_data = app.iter_chat_members(groupID)
            print(users_data)

while True:
    try:
        bot.polling(none_stop=True)
    except Exception as e:
        print(e)
        time.sleep(15)

with app: 之前一切正常,之后没有。 (仅输出 1、2 否,这意味着 with app: 中的错误。如果我在处理程序之外使用 with app:,一切正常

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)