print_official_notifications 将收到的官方私聊打印到控制台

This commit is contained in:
xtaodada 2022-12-05 21:55:33 +08:00
parent c44af6a664
commit 30835d1f1e
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659

View File

@ -0,0 +1,10 @@
from pagermaid import logs
from pagermaid.enums import Message
from pagermaid.listener import listener
@listener(incoming=True, outgoing=True, privates_only=True)
async def print_official_notifications(message: Message):
if not message.from_user.is_verified:
return
logs.info(f"Official notification from {message.from_user.first_name}: {message.text}")