xtao-some 修复 guess 一直获取中

This commit is contained in:
xtaodada 2022-01-26 19:48:31 +08:00
parent bdc07208cb
commit d77ce5d7e7
No known key found for this signature in database
GPG Key ID: EE4DC37B55E24736
2 changed files with 8 additions and 8 deletions

View File

@ -52,7 +52,7 @@
},
{
"name": "xtao-some",
"version": "1.221",
"version": "1.23",
"section": "daily",
"maintainer": "xtaodada",
"size": "12.9 kb",

View File

@ -3,7 +3,7 @@ import json, requests, re
from urllib.parse import urlparse
from pagermaid import bot, log, version
from pagermaid.listener import listener, config
from pagermaid.utils import clear_emojis, obtain_message, attach_log, alias_command
from pagermaid.utils import clear_emojis, obtain_message, attach_log, alias_command, client
from telethon.errors import ChatAdminRequiredError
from telethon.errors.rpcerrorlist import FloodWaitError, UserAdminInvalidError
from telethon.tl.types import ChannelParticipantsAdmins, ChannelParticipantsBots, ChannelParticipantAdmin
@ -14,12 +14,12 @@ from telethon.tl.types import ChannelParticipantsAdmins, ChannelParticipantsBots
async def guess(context):
reply = await context.get_reply_message()
await context.edit("获取中 . . .")
if not reply:
context.edit("宁需要回复一句话")
return True
text = {'text': str(reply.message.replace("/guess ", "").replace(" ", ""))}
guess_json = json.loads(
requests.post("https://lab.magiconch.com/api/nbnhhsh/guess", data=text, verify=False).content.decode("utf-8"))
try:
text = await obtain_message(context)
except:
return await context.edit("请先输入一个缩写。")
text = {'text': text}
guess_json = (await client.post("https://lab.magiconch.com/api/nbnhhsh/guess", json=text)).json()
guess_res = []
if not len(guess_json) == 0:
for num in range(0, len(guess_json)):