Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

discord-php-bot-security

Skill by discord-php

Audits DiscordPHP bots and API libraries for security issues. It covers token leaks, secrets in custom_ids and error messages, constant-time comparison, and OAuth, CSRF and webhook checks.

  • Score 76
  • 1.1k stars
  • MIT
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install discord-php-bot-security

Built from the published package, never by AI.

git clone --depth 1 https://github.com/discord-php/DiscordPHP /tmp/DiscordPHP && mkdir -p ~/.claude/skills && cp -r /tmp/DiscordPHP/.github/skills/discord-php-bot-security ~/.claude/skills/discord-php-bot-security

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install discord-php-bot-security in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

This agent skill is a security checklist for PHP code that uses DiscordPHP. It is built from findings in the DiscordPHP-MTG, DiscordPHP-NHA, DiscordPHP-Voice and Civilizationbot repositories. The checklist covers five areas: sending the Discord bot token to third-party APIs, keeping tokens out of logs and exception messages, keeping secrets out of custom_id values, OAuth2, CSRF and webhook handling, and repository hygiene.

The skill gives code patterns to follow, such as setting Authorization only when a real value exists and redacting tokens before logging. It also lists a quick ripgrep sweep to find risky patterns in src/. It is meant for developers reviewing an HTTP client, an error handler, an OAuth or webhook endpoint, or a repository before publishing it.

Written from the project's SKILL.md and checked against it.

What it can do

  • Token leak checkFlags Discord bot tokens sent to unrelated third-party API hosts in HTTP clients.
  • Log and exception redactionExplains how to keep tokens out of logs, 422 bodies and exception messages.
  • custom_id reviewChecks that agent or session tokens stay in server-side closures, not component custom_ids.
  • OAuth and CSRF checksCovers secure random state ids, hash_equals comparison and single-use state tokens.
  • Webhook signature checksAdvises verifying X-Hub-Signature-256 with hash_equals and failing closed when the secret is unset.
  • Redirect URI validationRequires the effective redirect_uri to be checked against an allow-list.
  • Repo hygiene reviewLists .gitignore entries and a git ls-files command to find tracked secrets.
  • Grep sweepProvides ripgrep patterns to find tokens in URLs, risky logging and weak randomness.

Try asking

  • Audit my DiscordPHP HTTP client for bot token leaks to third-party hosts
  • Check my webhook endpoint for signature verification and fail-closed behavior
  • Review my error handler for tokens exposed in logs or exception messages

Good to know

  • The checklist is based on findings from four named repositories.
  • The grep sweep uses rg (ripgrep) syntax.

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: .github/skills/discord-php-bot-security/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work

Inside the skill

  • SKILL.md5 KB

Alternatives to discord-php-bot-security

All alternatives →

Compare with function_health, windows-privilege-escalation or github-actions-advanced

discord-php-bot-security: common questions

Does this skill send my bot token anywhere?

The source does not describe any network calls. It is a checklist of code patterns to review and fix.

What is the custom_id rule in this skill?

Component custom_ids are sent to Discord and visible to clients, so the agent or session token should be captured in the server-side listener closure instead.

Why should I avoid uniqid() for OAuth state?

The skill says uniqid() is predictable because it is based on microtime. It recommends bin2hex(random_bytes(16)) instead.

How do I install discord-php-bot-security?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is discord-php-bot-security free?

The code is published under the MIT licence. The service it connects to may have its own pricing.

Is discord-php-bot-security safe to use?

It scores 76 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.

What are alternatives to discord-php-bot-security?

Similar skills: function_health, windows-privilege-escalation, github-actions-advanced, propose-security-hardening.

discord-php-bot-security Install

Add to stack

Loading.