Jump to content

HELP WITH CURL DISCORD WEBHOOK POST REQUEST


LegitSpiderman

Recommended Posts

Hey people of php freaks recently, I've been having issues changing a discord webhook [curl] post request to a website [curl] post request. My knowledge in PHP is very limited so, I really would appreciate some help

This is the function:

function postToDiscord($message)
{
    $data = array("content" => $message, "username" => "Payouts Bot");
    $curl = curl_init("https://discordapp.com/api/webhooks/591662537293168650/eyme87xmCuKne4njucoDSqzojq78NaS9x7t4sgP9m-l5EmrvUeZegkM4wok-L-UdBDxo");
    curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "POST");
    curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    return curl_exec($curl);
}

Currently the discord bot transfers the message into a discord channel and, I do not want that. I want it to transfer it onto a website page. As, I said i'm not very keen on this so please help me.

 

chrome_7lcW370TdC.png

Edited by LegitSpiderman
Link to comment
Share on other sites

Either I'm misunderstanding or you're talking about completely changing what this process does. And while you may not know PHP, you still have two options here: we help do you the work (which will require you to learn some PHP) or you find someone who'll do it for you (and it won't be free).

Assuming the former,

What website are you talking about? Send what data that was presumably combined into $message?

Link to comment
Share on other sites

8 minutes ago, requinix said:

Either I'm misunderstanding or you're talking about completely changing what this process does. And while you may not know PHP, you still have two options here: we help do you the work (which will require you to learn some PHP) or you find someone who'll do it for you (and it won't be free).

 Assuming the former,

What website are you talking about? Send what data that was presumably combined into $message?

It's for a offerwall website, which calculates the profit they made from completing offers, so it updates their points and it sends the payout message via a bot into that discord channel. All, I want is somebody to do the same thing. But make it send the message onto a web page via the same method. So, I'd need somebody to convert this into a website method.

Edited by LegitSpiderman
Link to comment
Share on other sites

1 minute ago, ginerjm said:

offerwall website?

send the message onto a web page?

website method?

What are these terms?  Strange language!

Haha, I don't have terms for them, but you could atleast understand the core topic is to make it post to a page not into a discord chat. Eh, i guess ill just learn php or get somebody to change it for me.

Link to comment
Share on other sites

Yeah, this is not something that a couple posts on a forum is going to solve. You're talking about integrating with some website's API. There's documentation to read, instructions to follow, possibly a developer account or API key to obtain...

We can still help but you're going to have to do a fair bit of work even to get the ball rolling here.

The first question you need to answer is what, technically speaking though not in terms of literal PHP code, is what your site needs to do. What data goes where and how. Translating that into PHP comes after.

  • Like 1
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.