discord-bot-helper
Discord.js v14 for building Discord bots - slash commands, events, components, embeds, and permissions When user works with Discord bots, discord.js, slash commands, Discord API, or mentions discord.js patterns
What this skill does
# Discord Bot Helper Agent
## What's New in Discord.js v14 (2024-2025)
- **Node.js 18.17+** required (v14.14+), 22+ recommended
- **PascalCase enums**: `ButtonStyle.Primary` instead of `'PRIMARY'`
- **Renamed builders**: `EmbedBuilder` (was `MessageEmbed`), `AttachmentBuilder` (was `MessageAttachment`)
- **Display components**: New layout and content elements beyond embeds
- **Gateway v10**: Updated event handling and intents
## Installation
```bash
# Install discord.js
npm install discord.js
# or
bun add discord.js
```
## Basic Bot Setup
### Main File (index.js)
```typescript
import { Client, Events, GatewayIntentBits } from "discord.js";
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.MessageContent, // Privileged intent
],
});
client.once(Events.ClientReady, (readyClient) => {
console.log(`Logged in as ${readyClient.user.tag}!`);
});
client.on(Events.InteractionCreate, async (interaction) => {
if (!interaction.isChatInputCommand()) return;
if (interaction.commandName === "ping") {
await interaction.reply("Pong!");
}
});
client.login(process.env.DISCORD_TOKEN);
```
## Gateway Intents
Intents control which events your bot receives:
### Common Intents
| Intent | Events Received |
| ------------------ | ------------------------------------------------- |
| `Guilds` | Guild create/update/delete, channels, roles |
| `GuildMembers` | Member join/leave/update (privileged) |
| `GuildMessages` | Message events in guilds |
| `MessageContent` | Message content, attachments, embeds (privileged) |
| `GuildVoiceStates` | Voice channel activity |
| `GuildPresences` | Member presence updates (privileged) |
| `DirectMessages` | DM message events |
### Privileged Intents
Require manual enabling in Discord Developer Portal:
- `GuildMembers`
- `GuildPresences`
- `MessageContent`
```typescript
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMembers, // Privileged
GatewayIntentBits.GuildPresences, // Privileged
GatewayIntentBits.MessageContent, // Privileged
],
});
```
## Slash Commands
### Command Definition
```typescript
// commands/ping.js
import { SlashCommandBuilder } from "discord.js";
export const data = new SlashCommandBuilder()
.setName("ping")
.setDescription("Replies with Pong!");
export async function execute(interaction) {
await interaction.reply("Pong!");
}
```
### Command with Options
```typescript
import { SlashCommandBuilder } from "discord.js";
export const data = new SlashCommandBuilder()
.setName("echo")
.setDescription("Replies with your input")
.addStringOption((option) =>
option
.setName("message")
.setDescription("The message to echo")
.setRequired(true),
)
.addUserOption((option) =>
option.setName("target").setDescription("User to mention"),
)
.addIntegerOption((option) =>
option
.setName("count")
.setDescription("Number of times")
.setMinValue(1)
.setMaxValue(10),
);
export async function execute(interaction) {
const message = interaction.options.getString("message");
const target = interaction.options.getUser("target");
const count = interaction.options.getInteger("count") ?? 1;
const reply = target
? `${target}, ${message.repeat(count)}`
: message.repeat(count);
await interaction.reply(reply);
}
```
### Command with Choices
```typescript
export const data = new SlashCommandBuilder()
.setName("gif")
.setDescription("Sends a gif")
.addStringOption((option) =>
option
.setName("category")
.setDescription("The gif category")
.setRequired(true)
.addChoices(
{ name: "Funny", value: "gif_funny" },
{ name: "Meme", value: "gif_meme" },
{ name: "Cute", value: "gif_cute" },
),
);
```
### Subcommands
```typescript
export const data = new SlashCommandBuilder()
.setName("user")
.setDescription("User commands")
.addSubcommand((subcommand) =>
subcommand
.setName("info")
.setDescription("Get user info")
.addUserOption((option) =>
option.setName("target").setDescription("The user"),
),
)
.addSubcommand((subcommand) =>
subcommand
.setName("avatar")
.setDescription("Get user avatar")
.addUserOption((option) =>
option.setName("target").setDescription("The user"),
),
);
export async function execute(interaction) {
const subcommand = interaction.options.getSubcommand();
const target = interaction.options.getUser("target") ?? interaction.user;
if (subcommand === "info") {
await interaction.reply(`User: ${target.tag}\nID: ${target.id}`);
} else if (subcommand === "avatar") {
await interaction.reply(target.displayAvatarURL({ size: 256 }));
}
}
```
### Registering Commands
```typescript
// deploy-commands.js
import { REST, Routes } from "discord.js";
import { commands } from "./commands/index.js";
const rest = new REST().setToken(process.env.DISCORD_TOKEN);
// Guild commands (instant, for development)
await rest.put(Routes.applicationGuildCommands(CLIENT_ID, GUILD_ID), {
body: commands.map((c) => c.data.toJSON()),
});
// Global commands (takes up to 1 hour to propagate)
await rest.put(Routes.applicationCommands(CLIENT_ID), {
body: commands.map((c) => c.data.toJSON()),
});
```
### Autocomplete
```typescript
export const data = new SlashCommandBuilder()
.setName("search")
.setDescription("Search something")
.addStringOption((option) =>
option
.setName("query")
.setDescription("Search query")
.setAutocomplete(true),
);
export async function autocomplete(interaction) {
const focusedValue = interaction.options.getFocused();
const choices = ["apple", "banana", "cherry", "date", "elderberry"];
const filtered = choices.filter((c) => c.startsWith(focusedValue));
await interaction.respond(
filtered.slice(0, 25).map((choice) => ({ name: choice, value: choice })),
);
}
export async function execute(interaction) {
const query = interaction.options.getString("query");
await interaction.reply(`You searched for: ${query}`);
}
```
## Response Methods
### Basic Responses
```typescript
// Simple reply
await interaction.reply("Hello!");
// Ephemeral reply (only visible to user)
await interaction.reply({ content: "Secret!", ephemeral: true });
// Deferred reply (for long operations)
await interaction.deferReply();
// ... do work ...
await interaction.editReply("Done!");
// Follow-up messages
await interaction.reply("First message");
await interaction.followUp("Second message");
await interaction.followUp({ content: "Ephemeral followup", ephemeral: true });
```
### Fetching the Reply
```typescript
const reply = await interaction.fetchReply();
console.log(reply.id);
```
## Embeds
### Creating Embeds
```typescript
import { EmbedBuilder } from "discord.js";
const embed = new EmbedBuilder()
.setColor(0x0099ff)
.setTitle("Embed Title")
.setURL("https://discord.js.org/")
.setAuthor({
name: "Author Name",
iconURL: "https://example.com/icon.png",
url: "https://example.com",
})
.setDescription("This is the main description")
.setThumbnail("https://example.com/thumbnail.png")
.addFields(
{ name: "Field 1", value: "Value 1", inline: true },
{ name: "Field 2", value: "Value 2", inline: true },
{ name: "Field 3", value: "Value 3" },
)
.setImage("https://example.com/image.png")
.setTimestamp()
.setFooter({
text: "Footer text",
iconURL: "https://example.com/footer.png",
});
await interaction.reply({ embeds: [embed] });
```
### Multiple Embeds
```typescript
const embed1 = new EmbedBuilder().setTitle("Embed 1").setColor(0xff0000);
const embed2 =Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.