fix(userbot): encode absent pyrogram raw payloads as empty json
This commit is contained in:
1 parent
6a6e63ff75
commit
676680319b
15 files changed
+63
-25
No files matched your search
@@ -4,6 +4,7 @@ from pyrogram.types import User
|
||||
|
||||
from userbot import PyroClient
|
||||
from userbot.modules.presence import repository
|
||||
from userbot.modules.raw_json import raw_json
|
||||
from utils.events import notify_bg_event
|
||||
|
||||
|
||||
@@ -20,7 +21,7 @@ async def on_user_status(client: PyroClient, user: User) -> None:
|
||||
user.status.name.lower(),
|
||||
user.last_online_date,
|
||||
user.next_offline_date,
|
||||
str(user.raw),
|
||||
raw_json(user.raw),
|
||||
)
|
||||
await ctx.watches.on_status(user.id, is_online=user.status.name.lower() == "online")
|
||||
await notify_bg_event(ctx.pool, "presence", ctx.account_id, chat_id=user.id)
|
||||
|
||||
Reference in new issue
Block a user