Actions
The SDK automatically detects 22 types of bot REST API calls by patching client.rest methods. Only the route and HTTP method are inspected -- no request or response payload is ever read.
How Actions Are Detected
The SDK patches four methods on client.rest:
| HTTP Method | Patched Method |
|---|---|
| POST | client.rest.post |
| PATCH | client.rest.patch |
| PUT | client.rest.put |
| DELETE | client.rest.delete |
Each outbound call is matched against a route table using regex patterns. When a match is found, the corresponding action_* event is emitted. The original REST call always passes through untouched -- errors are never swallowed or modified.
Count-only tracking
Actions record only the occurrence of a REST call. No message content, payload data, or response bodies are inspected or stored. Each action event contains only the event type, shard/cluster IDs, and extracted guild/channel IDs from the route path.
22 Action Types by Category
Messages (5 actions)
| Event Type | HTTP Method | REST Route | Description |
|---|---|---|---|
action_message_send | POST | /channels/{id}/messages | Bot sent a message |
action_message_edit | PATCH | /channels/{id}/messages/{id} | Bot edited a message |
action_message_delete | DELETE | /channels/{id}/messages/{id} | Bot deleted a message |
action_bulk_delete | POST | /channels/{id}/messages/bulk-delete | Bot bulk-deleted messages |
action_react | PUT | /channels/{id}/messages/{id}/reactions/... | Bot added a reaction |
Channels (3 actions)
| Event Type | HTTP Method | REST Route | Description |
|---|---|---|---|
action_channel_edit | PATCH | /channels/{id} | Bot edited a channel |
action_channel_delete | DELETE | /channels/{id} | Bot deleted a channel |
action_thread_create | POST | /channels/{id}/threads | Bot created a thread |
Roles (5 actions)
| Event Type | HTTP Method | REST Route | Description |
|---|---|---|---|
action_role_create | POST | /guilds/{id}/roles | Bot created a role |
action_role_edit | PATCH | /guilds/{id}/roles/{id} | Bot edited a role |
action_role_delete | DELETE | /guilds/{id}/roles/{id} | Bot deleted a role |
action_role_add | PUT | /guilds/{id}/members/{id}/roles/{id} | Bot added a role to a member |
action_role_remove | DELETE | /guilds/{id}/members/{id}/roles/{id} | Bot removed a role from a member |
Members (4 actions)
| Event Type | HTTP Method | REST Route | Description |
|---|---|---|---|
action_member_edit | PATCH | /guilds/{id}/members/{id} | Bot edited a member (nickname, timeout, etc.) |
action_member_ban | PUT | /guilds/{id}/bans/{id} | Bot banned a member |
action_member_unban | DELETE | /guilds/{id}/bans/{id} | Bot unbanned a member |
action_member_kick | DELETE | /guilds/{id}/members/{id} | Bot kicked a member |
Other (5 actions)
| Event Type | HTTP Method | REST Route | Description |
|---|---|---|---|
action_pin | PUT | /channels/{id}/pins/{id} | Bot pinned a message |
action_unpin | DELETE | /channels/{id}/pins/{id} | Bot unpinned a message |
action_permission_edit | PUT | /channels/{id}/permissions/{id} | Bot edited channel permission overwrites |
action_invite_create | POST | /channels/{id}/invites | Bot created an invite |
action_voice_session | -- | Voice session end | Bot voice session completed (with duration) |
Collected Fields
All action events share a minimal schema:
| Field | Type | Description |
|---|---|---|
shardId | integer | Shard that handled the REST call |
clusterId | integer | Cluster ID, when configured |
guildId | string | Server ID (extracted from route or channel cache) |
channelId | string | Channel ID (extracted from route, when applicable) |
Note
For channel-scoped routes (e.g., /channels/{id}/messages), the SDK looks up the guild ID from client.channels.cache. If the channel is not cached, guildId will be absent from the event.
Interaction Replies vs. Actions
Important distinction
interaction.reply(), interaction.editReply(), and interaction.followUp() are not detected as actions. These methods use Discord's webhook-based interaction response path, not the standard REST API. They are tracked as part of the Interaction response lifecycle instead.
Only direct REST calls through client.rest (e.g., channel.send(), member.ban(), role.edit()) are captured as actions.
Legacy Event Names
Some action types were renamed in SDK v0.5.0. The old names are still accepted in disabledEvents for backwards compatibility:
| Legacy Name | Current Name |
|---|---|
message_sent | action_message_send |
voice_session | action_voice_session |
INFO
The legacy names are deprecated and will be removed in a future version. Update your disabledEvents configuration to use the current names.
Disabling Specific Actions
You can disable individual action types via the disabledEvents option:
createDicolytics(client, {
apiKey: '...',
disabledEvents: [
'action_react', // Don't track reaction additions
'action_message_send', // Don't track message sends
],
});create_dicolytics(bot,
api_key="...",
disabled_events=[
"action_react", # Don't track reaction additions
"action_message_send", # Don't track message sends
],
)See Configuration for more details.