-2

Alright so im making a Get request to this python script I made and i turned it into a basic API using PHP to send the request to as you can see below

<?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!!!')

Whenever I do "!get email, message, number" it dosent work it dosent even say "Sent!!!!" what did I do wrong?

Gummie
  • 35
  • 1
  • 5

1 Answers1

1

The requests.get is made to send requests to an url, not to a file. I suggest to host that file on an url and then your bot sends a request to it.

filipporomani
  • 275
  • 3
  • 9