[英]How to make a get request in discord.py
好的,所以我向我制作的这个 python 脚本发出 Get 请求,然后我使用 PHP 将其变成基本的 API 以发送请求,如下所示
<?php
if(isset($_GET['GO']))
{
shell_exec("C:Users/Bear/desktop/smtp/test-sender.py");
echo"success";
}
?>
But whenever I go into the discord server and do the prefix and command it dosent work now here is the code I put in the discord bot to make a request to the API
import requests
@client.command()
async def get(ctx, rec_email=int, message=int, int1=int):
x = requests.GET(filename in os.listdir('./api.php'), parms ={"rec_email", "message", "int1"})
await ctx.send('Sent!!!')
每当我执行“,获取 email,消息?号码”时,它都没有工作,甚至说“已发送!!!!” 我做错了什么?
requests.get 用于将请求发送到 url,而不是文件。 我建议将该文件托管在 url 上,然后您的机器人向它发送请求。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.