Coder Social home page Coder Social logo

discordhook's Introduction

DiscordHook

PHP Discord WebHook Library Simple, All Cointained in One file!

Example:

To send a message...

DiscordHook::send(new Message(new User("WEBHOOK URL", "USERNAME", "AVARAR_URL"), "MSG"));

Need to upload a file or embed(s)? DiscordHook Support that too!

Upload a File...

DiscordHook::send(new Message(new User("WEBHOOK URL", "USERNAME", "AVARAR_URL"), "MSG",new Upload("PATH TO FILE","FILE NAME")));

Send With Embed(s)...

print_r(DiscordHook::send(new Message(new User("WEBHOOK URL", "USERNAME", "AVARAR_URL"), "MSG",new Embed("TITLE","DESCRIPTION","URL","COLOUR(int)")))); //single embed
print_r(DiscordHook::send(new Message(new User("WEBHOOK URL", "USERNAME", "AVARAR_URL"), "MSG",[new Embed("TITLE","DESCRIPTION","URL","COLOUR(int)"),new Embed("TITLE2","DESCRIPTION","URL","COLOUR(int)")]))); //multiple embeds

discordhook's People

Contributors

thunder33345 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

discordhook's Issues

Not working on live website

I cant send webhooks from my website and echo this return statement
-----Local Host------
Array ( [sent] => Array ( [array] => Array ( [username] => Recent Claim Sent Anouncer [content] => hello ) [json] => {"username":"Recent Claim Sent Anouncer","content":"hello"} ) [http_code] => 204 [headers] => Array ( [http_code] => HTTP/2 204 [date] => Tue, 25 Aug 2020 13:51:02 GMT [set_cookie] => __cfduid=d6c1fe260b1a41254df2b29e129b9cf621598363462; expires=Thu, 24-Sep-20 13:51:02 GMT; path=/; domain=.discordapp.com; HttpOnly; SameSite=Lax [strict_transport_security] => max-age=31536000; includeSubDomains [x_ratelimit_bucket] => 3cd1f278bd0ecaf11e0d2391374c011d [x_ratelimit_limit] => 5 [x_ratelimit_remaining] => 4 [x_ratelimit_reset] => 1598363465 [x_ratelimit_reset_after] => 2 [x_envoy_upstream_service_time] => 35 [via] => 1.1 google [cf_cache_status] => DYNAMIC [cf_request_id] => 04c77c04570000124cc5092200000001 [expect_ct] => max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" [server] => cloudflare [cf_ray] => 5c85c91a2d33124c-HKG ) [json] => [raw] => )

-----Website------
Array ( [sent] => Array ( [array] => Array ( [username] => Recent Claim Sent Anouncer [content] => New claim has been sent! ADDRESS:0x61c0fa8ef4c27357564de51747841851be8c4c55 BLOCKCHAIN SCANNER LINK: AMOUNT:0.0005 CoroEx Coin.Please check block chain Scanner link to confirm the transaction! ) [json] => {"username":"Recent Claim Sent Anouncer","content":"New claim has been sent! ADDRESS:0x61c0fa8ef4c27357564de51747841851be8c4c55\n BLOCKCHAIN SCANNER LINK: \n AMOUNT:0.0005 CoroEx Coin.Please check block chain Scanner link to confirm the transaction!"} ) [http_code] => [headers] => Array ( [http_code] => ) [json] => [raw] => )

unlike in local host it appears that the website is not sending anything.Can you help out fixing?
thanks

Wont send webhook on live website

I cant send webhooks from my website and echo this return statement
-----Local Host------
Array ( [sent] => Array ( [array] => Array ( [username] => Recent Claim Sent Anouncer [content] => hello ) [json] => {"username":"Recent Claim Sent Anouncer","content":"hello"} ) [http_code] => 204 [headers] => Array ( [http_code] => HTTP/2 204 [date] => Tue, 25 Aug 2020 13:51:02 GMT [set_cookie] => __cfduid=d6c1fe260b1a41254df2b29e129b9cf621598363462; expires=Thu, 24-Sep-20 13:51:02 GMT; path=/; domain=.discordapp.com; HttpOnly; SameSite=Lax [strict_transport_security] => max-age=31536000; includeSubDomains [x_ratelimit_bucket] => 3cd1f278bd0ecaf11e0d2391374c011d [x_ratelimit_limit] => 5 [x_ratelimit_remaining] => 4 [x_ratelimit_reset] => 1598363465 [x_ratelimit_reset_after] => 2 [x_envoy_upstream_service_time] => 35 [via] => 1.1 google [cf_cache_status] => DYNAMIC [cf_request_id] => 04c77c04570000124cc5092200000001 [expect_ct] => max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" [server] => cloudflare [cf_ray] => 5c85c91a2d33124c-HKG ) [json] => [raw] => )

-----Website------
Array ( [sent] => Array ( [array] => Array ( [username] => Recent Claim Sent Anouncer [content] => New claim has been sent! ADDRESS:0x61c0fa8ef4c27357564de51747841851be8c4c55 BLOCKCHAIN SCANNER LINK: AMOUNT:0.0005 CoroEx Coin.Please check block chain Scanner link to confirm the transaction! ) [json] => {"username":"Recent Claim Sent Anouncer","content":"New claim has been sent! ADDRESS:0x61c0fa8ef4c27357564de51747841851be8c4c55\n BLOCKCHAIN SCANNER LINK: \n AMOUNT:0.0005 CoroEx Coin.Please check block chain Scanner link to confirm the transaction!"} ) [http_code] => [headers] => Array ( [http_code] => ) [json] => [raw] => )

unlike in local host it appears that the website is not sending anything.Can you help out fixing?
thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.