소스 검색

filters go brrr

TheHamkerCat 5 년 전
부모
커밋
5fe25e9f82
2개의 변경된 파일과 3개의 추가작업 그리고 7개의 파일을 삭제
  1. 1 1
      wbb/modules/github.py
  2. 2 6
      wbb/modules/lydia.py

+ 1 - 1
wbb/modules/github.py

@@ -3,7 +3,7 @@ from pyrogram import filters
 from wbb import app
 
 __MODULE__ = 'Github'
-__HELP__ = "Get information about a GitHub user."
+__HELP__ = "Get information about a GitHub user.\n /github [username]"
 
 
 @app.on_message(filters.command('github'))

+ 2 - 6
wbb/modules/lydia.py

@@ -6,7 +6,7 @@ from wbb.utils.botinfo import BOT_ID
 from wbb import LYDIA_API
 
 __MODULE__ = 'Lydia'
-__HELP__ = "Lydia AI Chatbot"
+__HELP__ = "Lydia AI Chatbot\n /addchatbot - To Turn On Lydia\n /rmchatbot - To Turn Off Lydia"
 
 CoffeeHouseAPI = API(str(LYDIA_API))
 api_ = LydiaAI(CoffeeHouseAPI)
@@ -34,17 +34,13 @@ async def remove_chat(_, message):
         await message.reply_text('ChatBot Turned Off!')
 
 
-@app.on_message(~filters.edited & ~filters.private)
+@app.on_message(~filters.edited & ~filters.private & filters.text & filters.reply & ~filters.forwarded)
 async def chat_bot(_, message):
     global api_, chats, ses
     if message.chat.id not in chats:
         return
-    if not message.reply_to_message:
-        return
     if not message.reply_to_message.from_user.id == BOT_ID:
         return
-    if not message.text:
-        return
     await app.send_chat_action(message.chat.id, "typing")
     query = message.text
     rep = api_.think_thought(text=query, session_id=ses.id)