소스 검색

Fixed Peer id invalid bug

Your Name 5 년 전
부모
커밋
7fde6ff36e
1개의 변경된 파일과 2개의 추가작업 그리고 3개의 파일을 삭제
  1. 2 3
      wbb/modules/global_stats.py

+ 2 - 3
wbb/modules/global_stats.py

@@ -15,7 +15,6 @@ from wbb.utils.dbfunctions import (
         get_gbans_count
         )
 from pyrogram import filters
-from pyrogram.errors.exceptions.bad_request_400 import UserNotParticipant, PeerIdInvalid
 
 @app.on_message(filters.text, group=global_stats_group)
 @capture_err
@@ -45,9 +44,9 @@ async def global_stats(_, message):
         served_chats.append(int(chat["chat_id"]))
     for served_chat in served_chats:
         try:
-            await app.get_chat_member(served_chat, BOT_ID)
+            await app.get_chat_members(served_chat, BOT_ID)
         except Exception as e:
-            print(e)
+            print(f"{e} - {served_chat}")
             await remove_served_chat(served_chat)
             served_chats.remove(served_chat)
             pass