discord-php-interactions
Skill by discord-php
Guides developers building DiscordPHP slash commands and message components for Discord bots. It covers command trees, Components V2 layouts, click routing and permission-safe replies.
Install discord-php-interactions
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-interactions ~/.claude/skills/discord-php-interactionsRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
Step-by-step: install discord-php-interactions in Claude Code
git clone --depth 1 https://github.com/discord-php/DiscordPHP /tmp/DiscordPHP && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/DiscordPHP/.github/skills/discord-php-interactions ~/.gemini/antigravity-cli/skills/discord-php-interactionsAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install discord-php-interactions in Antigravity CLI
Skills can run scripts on your machine. Some need an API key: check the README.
About
This agent skill gives guidance for building Discord interactions with DiscordPHP, a PHP library. It covers global slash command trees with subcommands, commands that can be guild-installed or user-installed, and use in DMs, group DMs and guild channels. It also covers Components V2 builders such as Container, TextDisplay, ActionRow, Button and StringSelect. The source says it was verified against team-reflex/discord-php dev-master on Discord API v10.
The skill explains two ways to route component clicks: a per-component listener, or stable custom_ids with one central dispatcher. It also explains how to keep replies permission-safe by responding through the interaction. It warns against putting secrets in a custom_id and says to check the clicking user before acting. It is aimed at developers who add or change any slash command, button or select in a DiscordPHP bot.
Written from the project's SKILL.md and checked against it.
What it can do
- Global command treesRegisters a global slash command with subcommands and options, and creates it only if missing.
- Install and context settingsSets guild and user install types and the contexts where a command can be used, including DMs and group DMs.
- Components V2 layoutsComposes Container, TextDisplay, Separator, ActionRow, Button and StringSelect components.
- Component click routingRoutes button and select clicks either with per-component listeners or with a single dispatcher keyed on custom_id.
- Permission-safe repliesResponds through interaction methods such as respondWithMessage, updateMessage and sendFollowUpMessage.
- Actor validationChecks that the clicking user is authorised for the match before acting on a button or select.
What you need
- DiscordPHP library (team-reflex/discord-php)
- Discord API v10
- Access to the Discord Developer Portal to enable User Install
Try asking
- Add a /play subcommand with an opponent user option and a difficulty choice.
- Build a Components V2 board with a Container, TextDisplay and two buttons.
- Route all button clicks for my match through one dispatcher keyed on custom_id.
Good to know
- User-installed commands can only use interaction-scoped responses in channels the app is not a member of.
- User Install must also be toggled in the Developer Portal or the command setting is ignored.
- Per-component listeners can accumulate on long-lived interactive messages.
- Button and select clicks can be made by anyone who can see the message, so the actor must be checked.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: .github/skills/discord-php-interactions/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
SKILL.md6 KB
Alternatives to discord-php-interactions
All alternatives →Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.
Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.
Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.
Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.
Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.
Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.
Compare with openclaw-github-repo-commander, gradio or hig-components-menus
discord-php-interactions: common questions
Does this work with user-installed Discord commands?
Yes, the skill covers user-installable commands usable in DMs, group DMs and guild channels. It notes that User Install must also be enabled in the Developer Portal.
How should I handle button clicks in a DiscordPHP bot?
The source describes two approaches: a per-component listener, or stable custom_ids routed through one central INTERACTION_CREATE handler. It says the dispatcher avoids listener leaks and survives re-renders.
Can I store a token inside a custom_id?
No. The source says a custom_id is sent to Discord and visible in the client, so secrets should be captured in the server-side listener closure instead.
How do I install discord-php-interactions?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is discord-php-interactions free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is discord-php-interactions 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-interactions?
Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.
