jd_cmd fix a bug

This commit is contained in:
xtaodada 2022-01-20 21:03:15 +08:00
parent 68158a5586
commit fe09ee1a1d
No known key found for this signature in database
GPG Key ID: EE4DC37B55E24736
2 changed files with 3 additions and 3 deletions

View File

@ -2,7 +2,7 @@
from pagermaid import version
from pagermaid.listener import listener
from pagermaid.utils import lang, alias_command, obtain_message, post
from pagermaid.utils import lang, alias_command, obtain_message, client
@listener(is_plugin=False, outgoing=True, command=alias_command("jd_cmd"),
@ -14,7 +14,7 @@ async def jd_cmd(context):
except ValueError:
return await context.edit("[jd_cmd] " + lang("msg_ValueError"))
try:
data = (await post("https://api.jds.codes/jCommand", data={"code": text}, json_body=True)).json()
data = (await client.post("https://api.jds.codes/jCommand", json={"code": text})).json()
except:
return await context.edit("[jd_cmd] 网络错误!")
if data["code"] != 200:

View File

@ -812,7 +812,7 @@
},
{
"name": "jd_cmd",
"version": "1.011",
"version": "1.02",
"section": "chat",
"maintainer": "xtaodada",
"size": "1.00 kb",