{"id":34004893,"url":"https://github.com/hobsrkm/phpdiscordsdk","last_synced_at":"2026-04-19T22:03:22.123Z","repository":{"id":57040362,"uuid":"397592705","full_name":"hobsRKM/PHPDiscordSDK","owner":"hobsRKM","description":"A Light Weight PHP Discord SDK Library to build Discord Bots with Web Panel","archived":false,"fork":false,"pushed_at":"2021-09-15T13:22:32.000Z","size":120,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-14T22:26:33.568Z","etag":null,"topics":["discord","librarydiscord","phpbot","phpdiscord","phpdiscordbot","phpdiscordsdk"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hobsRKM.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-08-18T12:28:50.000Z","updated_at":"2023-09-22T07:32:51.000Z","dependencies_parsed_at":"2022-08-23T23:30:40.238Z","dependency_job_id":null,"html_url":"https://github.com/hobsRKM/PHPDiscordSDK","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/hobsRKM/PHPDiscordSDK","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hobsRKM%2FPHPDiscordSDK","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hobsRKM%2FPHPDiscordSDK/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hobsRKM%2FPHPDiscordSDK/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hobsRKM%2FPHPDiscordSDK/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hobsRKM","download_url":"https://codeload.github.com/hobsRKM/PHPDiscordSDK/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hobsRKM%2FPHPDiscordSDK/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32024251,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T20:23:30.271Z","status":"online","status_checked_at":"2026-04-19T02:00:07.110Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["discord","librarydiscord","phpbot","phpdiscord","phpdiscordbot","phpdiscordsdk"],"created_at":"2025-12-13T10:19:05.984Z","updated_at":"2026-04-19T22:03:22.110Z","avatar_url":"https://github.com/hobsRKM.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![build](https://github.com/hobsRKM/PHPDiscordSDK/actions/workflows/php.yml/badge.svg?branch=master)](https://github.com/hobsRKM/PHPDiscordSDK/actions/workflows/php.yml)  [![Codacy Security Scan](https://github.com/hobsRKM/PHPDiscordSDK/actions/workflows/codacy-analysis.yml/badge.svg?branch=master)](https://github.com/hobsRKM/PHPDiscordSDK/actions/workflows/codacy-analysis.yml)\n\n# PHPDiscordSDK\nA Light Weight PHP Discord SDK Library to build Discord Bots with Web Panel\n\n## PHPDiscordSDK\nA DiscordSDK  to build Discord Bots using PHP, with Web Panel.\n1. [Installation](#Installation)\n2. [Getting Started](#getting-started)\n3. [Listening to Bot Events](#botphp)\n4. [APIs](#APIs)\n   1. [SendMessage](#SendMessage)\n   2. [GetChannelDetails](#GetChannelDetails)\n   3. [UpdateChannelDetails](#UpdateChannelDetails)\n   4. [DeletChannel](#DeletChannel)\n   5. [Activity](#Presence)\n   6. Visit  documentation site for complete list\n\n####  Documentation\n**[Complete Docs of PHPDiscordSDK](https://phpdiscordsdk.gitbook.io/)**\n\n####  API Demo with Web Panel Integration\n**[discordapidemo.com](https://discordapidemo.com/)**\n\n### Installation\n\n- Requires **PHP \u003e=7.0**\n\n````\ncomposer require phpdiscordsdk/phpdiscordsdk\n````\n### Getting Started\n\n\u003e To start the bot you need to start it using **CLI (Command Line)**\n\u003e\n\u003e Once the bot is up and running, you can start using the [APIs](apis)\n\u003e\n\u003e You can  also use the APIs outside of bot  event listener , but it is recomended to first start the bot using CLI before consuming the APIs\n\u003e\n\u003e If you want to integerate into a framework and communicate with bot  you can implement something like  Web Panel\n\u003e\n\u003e  See Example  [(Web Panel)](https://github.com/hobsRKM/DiscordAPIWeb) (Supports both Send and Recieve)\n\n**Start  the bot**\n###  ```` $ php bot.php ````\n\n### bot.php\n\n```` php\n\u003c?php\n\nrequire('vendor/autoload.php');\n\nuse \\HobsRkm\\SDK\\PHPDiscordSDK\\PHPDiscordSDKFactory;\n\nclass Bot {\n\n    public function start() {\n        PHPDiscordSDKFactory::getInstance()\n            -\u003ebotConnect(\u003c\u003c\u003c\u003cBOT TOKEN\u003e\u003e\u003e\u003e\u003e)\n            -\u003ethen(\n                function ($bot) {\n                    $bot-\u003eon('message', function ($event) {\n                        PHPDiscordSDKFactory::getInstance()\n                        -\u003eformatEvent($event)-\u003ethen(function($message){\n                        //Bot Event Listener\n                        //call other APIs\n                            print_r($message);//prints server details\n                        }, function ($reason) {\n                        //message event errors\n                    });\n                     $bot-\u003eon('close', function ($event) {\n                       $this-\u003estart();\n                    });\n                });\n            },\n            function ($reason) {\n            //other errors, bot startup, authentication\n            }\n        );\n    }\n}\n\n$bot = new Bot();\n$bot-\u003estart();\n````\n![bot.php](https://web.inmelodies.in/wp-content/uploads/2021/08/Screenshot_2.png)\n\n\n## Example  1 - Send Message\n#### Calling APIs inside the Bot Listener ( Send Message to Discord)\n````php\n\u003c?php\nrequire('vendor/autoload.php');\n\nuse \\HobsRkm\\SDK\\PHPDiscordSDK\\PHPDiscordSDKFactory;\n\nPHPDiscordSDKFactory::getInstance()\n\t-\u003ebotConnect(\"\u003c\u003c\u003c\u003cBOT TOKEN\u003e\u003c\u003c\u003c\u003c\")\n\t-\u003ethen(\n\t\tfunction ($bot) {\n\t\t\t$bot-\u003eon('message', function ($event) {\n\t\t\t\tPHPDiscordSDKFactory::getInstance()\n\t\t\t\t-\u003eformatEvent($event)-\u003ethen(function($message){\n\t\t\t\t//Bot Event Listener\n\t\t\t\t//Server details\n\t\t\t\tprint_r($message);\n\t\t\t\t/**call Message API**/\n\t\t\t\t$body = array(\n                                        \"TYPE\"=\u003e\"CHANNEL_MESSAGE\",\n                                        \"body\"=\u003earray(\n                                            \"channel_id\"=\u003e\u003c\u003cYOUR CHANNEL ID\u003e\u003e\u003e,\n                                            \"content\"=\u003e\"Test Message\"\n                                            )\n                                        );\n\t\t\t\tPHPDiscordSDKFactory::getInstance('Messages')\n\t\t\t\t\t-\u003esendMessage($body)\n\t\t\t\t\t-\u003ethen(function($data){\n\t\t\t\t\t\t//Sent message details, including message id\n\t\t\t\t\t\tprint_r($data);\n\t\t\t\t\t}, \n\t\t\t\t\tfunction ($error) {\n\t\t\t\t\t\t//message event errors\n\t\t\t\t\t\tprint_r($error-\u003egetMessage());\n\t\t\t\t\t});\n\t\t\t\t}, function ($reason) {\n\t\t\t\t//message event errors\n\t\t\t});\n\t\t});\n\t},\n\tfunction ($reason) {\n\t//other errors, bot startup, authentication\n\t}\n);\n\n````\n## Example  2 - Get Channel Messages\n#### Calling APIs From Anywhere outside of   listener( Get Channel Messages)\n````php\n\u003c?php\nrequire('vendor/autoload.php');\n\nuse \\HobsRkm\\SDK\\PHPDiscordSDK\\PHPDiscordSDKFactory;\n  \n/**\nRequired Parameters\n**/\n$body = array(\n        \"TYPE\"=\u003e\"CHANNEL_DETAILS\",\n        \"body\"=\u003earray(\n            \"channel_id\"=\u003e\u003c\u003cYOUR CHANNEL ID\u003e\u003e\u003e,\n            )\n        );\n\nPHPDiscordSDKFactory::getInstance('Channels')\n\t-\u003egetChannelMessages($body)\n\t-\u003ethen(function($data){\n\t\t//Channel Messages\n\t\tprint_r($data);\n\t}, \n\tfunction ($error) {\n\t\t//message event errors\n\t\tprint_r($error-\u003egetMessage());\n\t\t//echo $error-\u003egetMessage();\t\n\t});\n````\n\n## Important\n\nThe following APIs cannot be called outside of Listener\n\n- **Presence**: This is used to Update your bot status such as\n   - Online\n   - DND\n   - AFK\n   - Actvity - Streaming, Playing or Watching Status\n\n# APIs\n\n\u003e The bot should have necessary Permissions on Discord Server\n\u003e\n\u003e Ex: Send message requires Send Message Perms on a channel\n\u003e\n\u003e For more information on specific permission, check the response body on each APIs.\n####  API Demo with Web Panel Integration\n**[discordapidemo.com](https://discordapidemo.com/)**\n### SendMessage\n\n````php\n    require('vendor/autoload.php');\n\n    use \\HobsRkm\\SDK\\PHPDiscordSDK\\PHPDiscordSDKFactory;\n\t\n    /**\n    Required - Channel Id\n    Content - You message, embeds supported - see Example Folder\t\n    **/\n    $body = array(\n    \"TYPE\"=\u003e\"CHANNEL_MESSAGE\",\n    \"body\"=\u003earray(\n        \"channel_id\"=\u003e\u003c\u003cYOUR CHANNEL ID\u003e\u003e\u003e,\n        \"content\"=\u003e\"Test Message\"\n        )\n    );\n    PHPDiscordSDKFactory::getInstance('Messages')\n        -\u003esendMessage($body)\n        -\u003ethen(function($data){\n            //Sent message details, including message id\n            print_r($data);\n        }, \n        function ($error) {\n            //message event errors\n            print_r($error-\u003egetMessage());\n        });\n\t\n````\n\n### GetChannelDetails\n\n````php\n    require('vendor/autoload.php');\n\n    use \\HobsRkm\\SDK\\PHPDiscordSDK\\PHPDiscordSDKFactory;\n\t\n    /**\n    Required - Channel Id\n    **/\n    $body = array(\n    \"TYPE\"=\u003e\"CHANNEL_DETAILS\",\n    \"body\"=\u003earray(\n        \"channel_id\"=\u003e\u003c\u003cYOUR CHANNEL ID\u003e\u003e\u003e,\n        )\n    );\n    PHPDiscordSDKFactory::getInstance('Channels')\n        -\u003egetChannelDetails($body)\n        -\u003ethen(function($data){\n            //channel details\n            print_r($data);\n        }, \n        function ($error) {\n            //message event errors\n            print_r($error-\u003egetMessage());\n        });\n\n````\n\n### DeleteChannel\n\n````php\n    require('vendor/autoload.php');\n\n    use \\HobsRkm\\SDK\\PHPDiscordSDK\\PHPDiscordSDKFactory;\n\t\n    /**\n    Required - Channel Id\n    **/\n    $body = array(\n    \"TYPE\"=\u003e\"CHANNEL_DETAILS\",\n    \"body\"=\u003earray(\n        \"channel_id\"=\u003e\u003c\u003cYOUR CHANNEL ID\u003e\u003e\u003e,\n        )\n    );\n    PHPDiscordSDKFactory::getInstance('Channels')\n        -\u003edeleteChannel($body)\n        -\u003ethen(function($data){\n            //channel details\n            print_r($data);\n        }, \n        function ($error) {\n            //message event errors\n            print_r($error-\u003egetMessage());\n        });\n\n````\n\n### UpdateChannelDetails\n\n````php\n    require('vendor/autoload.php');\n\n    use \\HobsRkm\\SDK\\PHPDiscordSDK\\PHPDiscordSDKFactory;\n\t\n\t/**\n\tRequired - Channel Id\n\tName - New channel Name\n\ticon - base64 encoded icon\n\t**/\n\t$body = array(\n\t\"TYPE\"=\u003e\"CHANNEL_DETAILS\",\n\t\"body\"=\u003earray(\n\t\t\"channel_id\"=\u003e\u003c\u003cYOUR CHANNEL ID\u003e\u003e\u003e,\n\t\t\"name\"=\u003e\u003c\u003cYOUR NEW CHANNEL NAME\u003e\u003e,\n\t\t\"icon\"=\u003e\u003c\u003c\u003cBASE 64 ENCODED ICON\u003e\u003e\n\t\t)\n\t);\n\tPHPDiscordSDKFactory::getInstance('Channels')\n\t\t-\u003eupdateChannelDetails($body)\n\t\t-\u003ethen(function($data){\n\t\t\t//channel details\n\t\t\tprint_r($data);\n\t\t}, \n\t\tfunction ($error) {\n\t\t\t//message event errors\n\t\t\tprint_r($error-\u003egetMessage());\n\t\t});\n\n````\n\n### Presence\n\n\u003e Cannot be used outside of bot listener events, has to be used inside the startup script\n\n\n\n````php\n\u003c?php\nrequire('vendor/autoload.php');\n\nuse \\HobsRkm\\SDK\\PHPDiscordSDK\\PHPDiscordSDKFactory;\n\nPHPDiscordSDKFactory::getInstance()\n            -\u003ebotConnect(\"\u003c\u003c\u003c\u003cBOT TOKEN\u003e\u003c\u003c\u003c\u003c\")\n            -\u003ethen( \n                function ($bot) {\n                    $bot-\u003eon('message', function ($event) {\n                        PHPDiscordSDKFactory::getInstance()-\u003eformatEvent($event)-\u003ethen(function($message){\n                         //All events sent from client will be available here, including the server details the bot is listening on\n                        /**\n                        call Presence API\n                        The change is not instant, discord has a delay to update your status not to often\n                        status - dnd | offline |online | afk\n                        type - one of PLAYING,STREAMING,\n                        LISTENING,WATCHING,COMPETING\n                        **/\n                        PHPDiscordSDKFactory::getInstance('Presence')\n                        -\u003esetActivity(\n                            array(\n                                \"activity\"=\u003e\"Playing CS:GO\",\n                                \"status\"=\u003e\"dnd\",\n                                \"type\"=\u003e'PLAYING'\n                                )\n                            );                        \n                        }, function ($reason) {\n                            //message event errors\n                            print_r($reason-\u003egetMessage());\n                            //echo $reason-\u003egetMessage();\n                        });\n                    });\n                },\n                function ($reason) {\n                    print_r($reason);\n                    //other errors, bot startup, authentication\n                }\n            );\n\n````\n####  Documentation\n### **[Complete Docs of PHPDiscordSDK](https://phpdiscordsdk.gitbook.io/)**\n\n### Web Panel\n### **[discordapidemo.com](https://github.com/hobsRKM/DiscordAPIWeb)**\n\n\u003e Project is Open for contributions , please feel free to fork\n\n**Contribution Guide**\n\n- All Pull requests should be from a Local Branch of Develop\n- Be sure to check out Develop Branch\n- Any other pull requests to master  or other branches will be rejected\n\n\u0026copy;MIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhobsrkm%2Fphpdiscordsdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhobsrkm%2Fphpdiscordsdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhobsrkm%2Fphpdiscordsdk/lists"}