Discord integration for Ruby / Pokémon SDK projects
Rich Presence (IPC) + Webhook (HTTP) with a clean DSL
-
Download Discord.psdkplug
-
Place the plugin in your project/scripts:
Discord.psdkplug -
Run this command at the root of your project:
.\psdk --util=plugin load -
Configure Discord settings (
Data/configs/discord_config.json).
Here’s an example of a typical Rich Presence activity setup:
setup_rich_presence.mp4
Discord::RichPresence.start| Field | Required | Description |
|---|---|---|
| client_id | ✅ | Discord Application ID |
Discord::RichPresence.update(
details: "In battle",
state: "Arena",
assets: {
large_image: "arena",
small_image: "player"
}
)| Field | Required | Type | Notes |
|---|---|---|---|
| details | ❌ | String | Max 128 chars |
| state | ❌ | String | Max 128 chars |
| timestamps.start | ❌ | Integer | Unix timestamp |
| assets.large_image | ❌ | String | Asset key |
| assets.large_text | ❌ | String | Hover text |
| assets.small_image | ❌ | String | Asset key |
| assets.small_text | ❌ | String | Hover text |
Only provided fields are sent.
nilremoves the field.
Discord::RichPresence.pause
Discord::RichPresence.resume| Method | Effect |
|---|---|
| pause | Clears activity |
| resume | Restores last activity |
Discord::RichPresence.stop- Closes IPC socket
- Stops background thread
Based on official Discord Webhook & Embed API.
Discord::Webhook.send(content: "Server online")| Field | Required | Type |
|---|---|---|
| webhook_url | ✅ | String |
| content | ❌ | String |
| username | ❌ | String |
| avatar_url | ❌ | String |
| embeds | ❌ | Array |
embed = Discord::Webhook.embed
.title("Status")
.description("Server running")
.color("#5865F2")
.timestampSend it:
Discord::Webhook.send(
embeds: [embed.to_h]
)| Field | Required | Type | Limits |
|---|---|---|---|
| title | ❌ | String | 256 chars |
| description | ❌ | String | 4096 chars |
| url | ❌ | String | Valid URL |
| timestamp | ❌ | ISO8601 | |
| color | ❌ | String | HEX |
| Field | Required | Type |
|---|---|---|
| name | ❌ | String |
| url | ❌ | String |
| icon_url | ❌ | String |
| Field | Required | Type |
|---|---|---|
| text | ❌ | String |
| icon_url | ❌ | String |
| Field | Required | Type |
|---|---|---|
| url | ❌ | String |
| Field | Required | Type | Limits |
|---|---|---|---|
| name | ✅ | String | 256 chars |
| value | ✅ | String | 1024 chars |
| inline | ❌ | Boolean |
- Max embeds per message: 10
- Max fields per embed: 25
- Total embed size: 6000 chars
Discord::Webhook.send(
content: "Game update",
embeds: [embed.to_h]
)- Removes all
@characters - Prevents:
@everyone@here- Role mentions
- User mentions
Enabled by default on:
- content
- username
- embed text
The embed section allows you to have a default structure, so you do not need to build embeds manually for each message.
{
"client_id": "DISCORD_APP_ID",
"details": "Default details",
"state": "Default state",
"large_image": "large",
"small_image": "small",
"large_text": "Large hover",
"small_text": "Small hover",
"webhook_url": "WEBHOOK_URL",
"color": "#5865F2",
"title": "Default title",
"url": null,
"author_name": "Author",
"author_icon": null,
"author_url": null,
"thumbnail": null,
"description": "Default description",
"image": null,
"footer_text": "Footer",
"footer_icon": null
}All fields are optional, except those marked as required by Discord. If you do not want them, set them to
null. The default embed structure ensures you have a working format out-of-the-box without needing to manually define every field each time.
Free to use, modify and distribute.
Made with ❤️ for Pokémon SDK & Ruby projects. Inspired by Discord IPC & Webhook official APIs.
