mirror of
https://github.com/TeamPGM/PagerMaid_Plugins.git
synced 2024-11-23 09:51:41 +00:00
xtao-some 修复 guess 一直获取中
This commit is contained in:
parent
bdc07208cb
commit
d77ce5d7e7
@ -52,7 +52,7 @@
|
||||
},
|
||||
{
|
||||
"name": "xtao-some",
|
||||
"version": "1.221",
|
||||
"version": "1.23",
|
||||
"section": "daily",
|
||||
"maintainer": "xtaodada",
|
||||
"size": "12.9 kb",
|
||||
|
14
xtao-some.py
14
xtao-some.py
@ -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)):
|
||||
|
Loading…
Reference in New Issue
Block a user