Skip to content

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 MethodPatched Method
POSTclient.rest.post
PATCHclient.rest.patch
PUTclient.rest.put
DELETEclient.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 TypeHTTP MethodREST RouteDescription
action_message_sendPOST/channels/{id}/messagesBot sent a message
action_message_editPATCH/channels/{id}/messages/{id}Bot edited a message
action_message_deleteDELETE/channels/{id}/messages/{id}Bot deleted a message
action_bulk_deletePOST/channels/{id}/messages/bulk-deleteBot bulk-deleted messages
action_reactPUT/channels/{id}/messages/{id}/reactions/...Bot added a reaction

Channels (3 actions)

Event TypeHTTP MethodREST RouteDescription
action_channel_editPATCH/channels/{id}Bot edited a channel
action_channel_deleteDELETE/channels/{id}Bot deleted a channel
action_thread_createPOST/channels/{id}/threadsBot created a thread

Roles (5 actions)

Event TypeHTTP MethodREST RouteDescription
action_role_createPOST/guilds/{id}/rolesBot created a role
action_role_editPATCH/guilds/{id}/roles/{id}Bot edited a role
action_role_deleteDELETE/guilds/{id}/roles/{id}Bot deleted a role
action_role_addPUT/guilds/{id}/members/{id}/roles/{id}Bot added a role to a member
action_role_removeDELETE/guilds/{id}/members/{id}/roles/{id}Bot removed a role from a member

Members (4 actions)

Event TypeHTTP MethodREST RouteDescription
action_member_editPATCH/guilds/{id}/members/{id}Bot edited a member (nickname, timeout, etc.)
action_member_banPUT/guilds/{id}/bans/{id}Bot banned a member
action_member_unbanDELETE/guilds/{id}/bans/{id}Bot unbanned a member
action_member_kickDELETE/guilds/{id}/members/{id}Bot kicked a member

Other (5 actions)

Event TypeHTTP MethodREST RouteDescription
action_pinPUT/channels/{id}/pins/{id}Bot pinned a message
action_unpinDELETE/channels/{id}/pins/{id}Bot unpinned a message
action_permission_editPUT/channels/{id}/permissions/{id}Bot edited channel permission overwrites
action_invite_createPOST/channels/{id}/invitesBot created an invite
action_voice_session--Voice session endBot voice session completed (with duration)

Collected Fields

All action events share a minimal schema:

FieldTypeDescription
shardIdintegerShard that handled the REST call
clusterIdintegerCluster ID, when configured
guildIdstringServer ID (extracted from route or channel cache)
channelIdstringChannel 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 NameCurrent Name
message_sentaction_message_send
voice_sessionaction_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:

ts
createDicolytics(client, {
  apiKey: '...',
  disabledEvents: [
    'action_react',         // Don't track reaction additions
    'action_message_send',  // Don't track message sends
  ],
});
python
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.

Dicolytics — Discord bot analytics