eat fix a bug

This commit is contained in:
xtaodada 2021-11-28 16:58:47 +08:00
parent 21547d85ce
commit 675eef29e9
No known key found for this signature in database
GPG Key ID: EE4DC37B55E24736
2 changed files with 4 additions and 2 deletions

4
eat.py
View File

@ -15,7 +15,7 @@ from telethon.errors.rpcerrorlist import ChatSendStickersForbiddenError
from struct import error as StructError from struct import error as StructError
from pagermaid.listener import listener from pagermaid.listener import listener
from pagermaid.utils import alias_command from pagermaid.utils import alias_command
from pagermaid import redis, config, bot from pagermaid import redis, config, bot, user_id
from collections import defaultdict from collections import defaultdict
import json import json
@ -43,6 +43,8 @@ configFileRemoteUrlKey = "eat.configFileRemoteUrl"
async def get_full_id(object_n): async def get_full_id(object_n):
if isinstance(object_n, Channel): if isinstance(object_n, Channel):
return (await bot(GetFullChannelRequest(object_n.id))).full_chat.id # noqa return (await bot(GetFullChannelRequest(object_n.id))).full_chat.id # noqa
elif not object_n:
return user_id
return (await bot(GetFullUserRequest(object_n.id))).user.id return (await bot(GetFullUserRequest(object_n.id))).user.id

View File

@ -202,7 +202,7 @@
}, },
{ {
"name": "eat", "name": "eat",
"version": "1.041", "version": "1.042",
"section": "profile", "section": "profile",
"maintainer": "SF_PICK", "maintainer": "SF_PICK",
"size": "22.3 kb", "size": "22.3 kb",