mirror of
https://github.com/TeamPGM/PagerMaid_Plugins.git
synced 2024-11-24 12:33:37 +00:00
jd_cmd fix a bug
This commit is contained in:
parent
68158a5586
commit
fe09ee1a1d
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
from pagermaid import version
|
from pagermaid import version
|
||||||
from pagermaid.listener import listener
|
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"),
|
@listener(is_plugin=False, outgoing=True, command=alias_command("jd_cmd"),
|
||||||
@ -14,7 +14,7 @@ async def jd_cmd(context):
|
|||||||
except ValueError:
|
except ValueError:
|
||||||
return await context.edit("[jd_cmd] " + lang("msg_ValueError"))
|
return await context.edit("[jd_cmd] " + lang("msg_ValueError"))
|
||||||
try:
|
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:
|
except:
|
||||||
return await context.edit("[jd_cmd] 网络错误!")
|
return await context.edit("[jd_cmd] 网络错误!")
|
||||||
if data["code"] != 200:
|
if data["code"] != 200:
|
||||||
|
Loading…
Reference in New Issue
Block a user