Concord - C Discord API library
A Discord API wrapper library written in C
Events

Events sent over the Gateway socket to the client. More...

Collaboration diagram for Events:

Typedefs

typedef enum discord_event_scheduler discord_event_scheduler_t
 return value of discord_set_event_scheduler() callback More...
 
typedef enum discord_event_scheduler(* discord_ev_scheduler) (struct discord *client, const char data[], size_t size, enum discord_gateway_events event)
 Event Handling Mode callback. More...
 

Enumerations

enum  discord_gateway_events {
  DISCORD_EV_NONE = 0 , DISCORD_EV_READY , DISCORD_EV_RESUMED , DISCORD_EV_RECONNECT ,
  DISCORD_EV_INVALID_SESSION , DISCORD_EV_APPLICATION_COMMAND_PERMISSIONS_UPDATE , DISCORD_EV_AUTO_MODERATION_RULE_CREATE , DISCORD_EV_AUTO_MODERATION_RULE_UPDATE ,
  DISCORD_EV_AUTO_MODERATION_RULE_DELETE , DISCORD_EV_AUTO_MODERATION_ACTION_EXECUTION , DISCORD_EV_CHANNEL_CREATE , DISCORD_EV_CHANNEL_UPDATE ,
  DISCORD_EV_CHANNEL_DELETE , DISCORD_EV_CHANNEL_PINS_UPDATE , DISCORD_EV_THREAD_CREATE , DISCORD_EV_THREAD_UPDATE ,
  DISCORD_EV_THREAD_DELETE , DISCORD_EV_THREAD_LIST_SYNC , DISCORD_EV_THREAD_MEMBER_UPDATE , DISCORD_EV_THREAD_MEMBERS_UPDATE ,
  DISCORD_EV_GUILD_CREATE , DISCORD_EV_GUILD_UPDATE , DISCORD_EV_GUILD_DELETE , DISCORD_EV_GUILD_BAN_ADD ,
  DISCORD_EV_GUILD_BAN_REMOVE , DISCORD_EV_GUILD_EMOJIS_UPDATE , DISCORD_EV_GUILD_STICKERS_UPDATE , DISCORD_EV_GUILD_INTEGRATIONS_UPDATE ,
  DISCORD_EV_GUILD_MEMBER_ADD , DISCORD_EV_GUILD_MEMBER_REMOVE , DISCORD_EV_GUILD_MEMBER_UPDATE , DISCORD_EV_GUILD_MEMBERS_CHUNK ,
  DISCORD_EV_GUILD_ROLE_CREATE , DISCORD_EV_GUILD_ROLE_UPDATE , DISCORD_EV_GUILD_ROLE_DELETE , DISCORD_EV_GUILD_SCHEDULED_EVENT_CREATE ,
  DISCORD_EV_GUILD_SCHEDULED_EVENT_UPDATE , DISCORD_EV_GUILD_SCHEDULED_EVENT_DELETE , DISCORD_EV_GUILD_SCHEDULED_EVENT_USER_ADD , DISCORD_EV_GUILD_SCHEDULED_EVENT_USER_REMOVE ,
  DISCORD_EV_INTEGRATION_CREATE , DISCORD_EV_INTEGRATION_UPDATE , DISCORD_EV_INTEGRATION_DELETE , DISCORD_EV_INTERACTION_CREATE ,
  DISCORD_EV_INVITE_CREATE , DISCORD_EV_INVITE_DELETE , DISCORD_EV_MESSAGE_CREATE , DISCORD_EV_MESSAGE_UPDATE ,
  DISCORD_EV_MESSAGE_DELETE , DISCORD_EV_MESSAGE_DELETE_BULK , DISCORD_EV_MESSAGE_REACTION_ADD , DISCORD_EV_MESSAGE_REACTION_REMOVE ,
  DISCORD_EV_MESSAGE_REACTION_REMOVE_ALL , DISCORD_EV_MESSAGE_REACTION_REMOVE_EMOJI , DISCORD_EV_PRESENCE_UPDATE , DISCORD_EV_STAGE_INSTANCE_CREATE ,
  DISCORD_EV_STAGE_INSTANCE_DELETE , DISCORD_EV_STAGE_INSTANCE_UPDATE , DISCORD_EV_TYPING_START , DISCORD_EV_USER_UPDATE ,
  DISCORD_EV_VOICE_STATE_UPDATE , DISCORD_EV_VOICE_SERVER_UPDATE , DISCORD_EV_WEBHOOKS_UPDATE , DISCORD_EV_MAX
}
 Discord Gateway's events. More...
 
enum  discord_event_scheduler { DISCORD_EVENT_IGNORE , DISCORD_EVENT_MAIN_THREAD , DISCORD_EVENT_WORKER_THREAD }
 return value of discord_set_event_scheduler() callback More...
 

Functions

void discord_set_event_scheduler (struct discord *client, discord_ev_scheduler callback)
 Provides control over Discord event's callback scheduler. More...
 
void discord_add_intents (struct discord *client, uint64_t code)
 Subscribe to Discord Events. More...
 
void discord_remove_intents (struct discord *client, uint64_t code)
 Unsubscribe from Discord Events. More...
 
void discord_set_prefix (struct discord *client, const char prefix[])
 Set a mandatory prefix before commands. More...
 
void discord_set_on_command (struct discord *client, char *command, void(*callback)(struct discord *client, const struct discord_message *event))
 Set command/callback pair. More...
 
void discord_set_on_commands (struct discord *client, char *const commands[], int amount, void(*callback)(struct discord *client, const struct discord_message *event))
 Set a variadic series of NULL terminated commands to a callback. More...
 
void discord_set_next_wakeup (struct discord *client, int64_t delay)
 Set the time for wakeup function to be called. More...
 
void discord_set_on_wakeup (struct discord *client, void(*callback)(struct discord *client))
 Triggered at a arbitrary interval value set at discord_set_next_wakeup() More...
 
void discord_set_on_idle (struct discord *client, void(*callback)(struct discord *client))
 Triggers when idle. More...
 
void discord_set_on_cycle (struct discord *client, void(*callback)(struct discord *client))
 Triggers once per event-loop cycle. More...
 
void discord_set_on_ready (struct discord *client, void(*callback)(struct discord *client, const struct discord_ready *event))
 Triggers when the client session is ready. More...
 
void discord_set_on_application_command_permissions_update (struct discord *client, void(*callback)(struct discord *client, const struct discord_application_command_permissions *event))
 Triggers when an application command permission is updated. More...
 
void discord_set_on_auto_moderation_rule_create (struct discord *client, void(*callback)(struct discord *client, const struct discord_auto_moderation_rule *event))
 Triggers when an auto moderation rule is created. More...
 
void discord_set_on_auto_moderation_rule_update (struct discord *client, void(*callback)(struct discord *client, const struct discord_auto_moderation_rule *event))
 Triggers when an auto moderation rule is updated. More...
 
void discord_set_on_auto_moderation_rule_delete (struct discord *client, void(*callback)(struct discord *client, const struct discord_auto_moderation_rule *event))
 Triggers when an auto moderation rule is deleted. More...
 
void discord_set_on_auto_moderation_action_execution (struct discord *client, void(*callback)(struct discord *client, const struct discord_auto_moderation_action_execution *event))
 Triggers when an auto moderation rule is triggered and an execution is executed (e.g a message was blocked) More...
 
void discord_set_on_channel_create (struct discord *client, void(*callback)(struct discord *client, const struct discord_channel *event))
 Triggers when a channel is created. More...
 
void discord_set_on_channel_update (struct discord *client, void(*callback)(struct discord *client, const struct discord_channel *event))
 Triggers when a channel is updated. More...
 
void discord_set_on_channel_delete (struct discord *client, void(*callback)(struct discord *client, const struct discord_channel *event))
 Triggers when a channel is deleted. More...
 
void discord_set_on_channel_pins_update (struct discord *client, void(*callback)(struct discord *client, const struct discord_channel_pins_update *event))
 Triggers when a channel pin is updated. More...
 
void discord_set_on_thread_create (struct discord *client, void(*callback)(struct discord *client, const struct discord_channel *event))
 Triggers when a thread is created. More...
 
void discord_set_on_thread_update (struct discord *client, void(*callback)(struct discord *client, const struct discord_channel *event))
 Triggers when a thread is updated. More...
 
void discord_set_on_thread_delete (struct discord *client, void(*callback)(struct discord *client, const struct discord_channel *event))
 Triggers when a thread is deleted. More...
 
void discord_set_on_thread_list_sync (struct discord *client, void(*callback)(struct discord *client, const struct discord_thread_list_sync *event))
 Triggers when the current user gains access to a channel. More...
 
void discord_set_on_thread_member_update (struct discord *client, void(*callback)(struct discord *client, const struct discord_thread_member *event))
 Triggers when a thread the bot is in gets updated. More...
 
void discord_set_on_thread_members_update (struct discord *client, void(*callback)(struct discord *client, const struct discord_thread_members_update *event))
 Triggers when someone is added or removed from a thread. More...
 
void discord_set_on_guild_create (struct discord *client, void(*callback)(struct discord *client, const struct discord_guild *event))
 Triggers when a guild is created. More...
 
void discord_set_on_guild_update (struct discord *client, void(*callback)(struct discord *client, const struct discord_guild *event))
 Triggers when a guild is updated. More...
 
void discord_set_on_guild_delete (struct discord *client, void(*callback)(struct discord *client, const struct discord_guild *event))
 Triggers when a guild is deleted. More...
 
void discord_set_on_guild_ban_add (struct discord *client, void(*callback)(struct discord *client, const struct discord_guild_ban_add *event))
 Triggers when a user is banned from a guild. More...
 
void discord_set_on_guild_ban_remove (struct discord *client, void(*callback)(struct discord *client, const struct discord_guild_ban_remove *event))
 Triggers when a user is unbanned from a guild. More...
 
void discord_set_on_guild_emojis_update (struct discord *client, void(*callback)(struct discord *client, const struct discord_guild_emojis_update *event))
 Triggers when a guild emojis are updated. More...
 
void discord_set_on_guild_stickers_update (struct discord *client, void(*callback)(struct discord *client, const struct discord_guild_stickers_update *event))
 Triggers when a guild stickers are updated. More...
 
void discord_set_on_guild_integrations_update (struct discord *client, void(*callback)(struct discord *client, const struct discord_guild_integrations_update *event))
 Triggers when a guild integrations are updated. More...
 
void discord_set_on_guild_member_add (struct discord *client, void(*callback)(struct discord *client, const struct discord_guild_member *event))
 Triggers when a guild member is added. More...
 
void discord_set_on_guild_member_update (struct discord *client, void(*callback)(struct discord *client, const struct discord_guild_member_update *event))
 Triggers when a guild member is updated. More...
 
void discord_set_on_guild_member_remove (struct discord *client, void(*callback)(struct discord *client, const struct discord_guild_member_remove *event))
 Triggers when a guild member is removed. More...
 
void discord_set_on_guild_members_chunk (struct discord *client, void(*callback)(struct discord *client, const struct discord_guild_members_chunk *event))
 Triggers in response to discord_request_guild_members() More...
 
void discord_set_on_guild_role_create (struct discord *client, void(*callback)(struct discord *client, const struct discord_guild_role_create *event))
 Triggers when a guild role is created. More...
 
void discord_set_on_guild_role_update (struct discord *client, void(*callback)(struct discord *client, const struct discord_guild_role_update *event))
 Triggers when a guild role is updated. More...
 
void discord_set_on_guild_role_delete (struct discord *client, void(*callback)(struct discord *client, const struct discord_guild_role_delete *event))
 Triggers when a guild role is deleted. More...
 
void discord_set_on_guild_scheduled_event_create (struct discord *client, void(*callback)(struct discord *client, const struct discord_guild_scheduled_event *event))
 Triggers when a guild scheduled event is created. More...
 
void discord_set_on_guild_scheduled_event_update (struct discord *client, void(*callback)(struct discord *client, const struct discord_guild_scheduled_event *event))
 Triggers when a guild scheduled event is updated. More...
 
void discord_set_on_guild_scheduled_event_delete (struct discord *client, void(*callback)(struct discord *client, const struct discord_guild_scheduled_event *event))
 Triggers when a guild scheduled event is deleted. More...
 
void discord_set_on_guild_scheduled_event_user_add (struct discord *client, void(*callback)(struct discord *client, const struct discord_guild_scheduled_event_user_add *event))
 Triggers when a user subscribes to a guild scheduled event. More...
 
void discord_set_on_guild_scheduled_event_user_remove (struct discord *client, void(*callback)(struct discord *client, const struct discord_guild_scheduled_event_user_remove *event))
 Triggers when a user unsubscribes from a guild scheduled event. More...
 
void discord_set_on_integration_create (struct discord *client, void(*callback)(struct discord *client, const struct discord_integration *event))
 Triggers when a guild integration is created. More...
 
void discord_set_on_integration_update (struct discord *client, void(*callback)(struct discord *client, const struct discord_integration *event))
 Triggers when a guild integration is updated. More...
 
void discord_set_on_integration_delete (struct discord *client, void(*callback)(struct discord *client, const struct discord_integration_delete *event))
 Triggers when a guild integration is deleted. More...
 
void discord_set_on_interaction_create (struct discord *client, void(*callback)(struct discord *client, const struct discord_interaction *event))
 Triggers when user has used an interaction, such as an application command. More...
 
void discord_set_on_invite_create (struct discord *client, void(*callback)(struct discord *client, const struct discord_invite_create *event))
 Triggers when an invite to a channel has been created. More...
 
void discord_set_on_invite_delete (struct discord *client, void(*callback)(struct discord *client, const struct discord_invite_delete *event))
 Triggers when an invite to a channel has been deleted. More...
 
void discord_set_on_message_create (struct discord *client, void(*callback)(struct discord *client, const struct discord_message *event))
 Triggers when a message is created. More...
 
void discord_set_on_message_update (struct discord *client, void(*callback)(struct discord *client, const struct discord_message *event))
 Triggers when a message is updated. More...
 
void discord_set_on_message_delete (struct discord *client, void(*callback)(struct discord *client, const struct discord_message_delete *event))
 Triggers when a message is deleted. More...
 
void discord_set_on_message_delete_bulk (struct discord *client, void(*callback)(struct discord *client, const struct discord_message_delete_bulk *event))
 Triggers when messages are deleted in bulk. More...
 
void discord_set_on_message_reaction_add (struct discord *client, void(*callback)(struct discord *client, const struct discord_message_reaction_add *event))
 Triggers when a message reaction is added. More...
 
void discord_set_on_message_reaction_remove (struct discord *client, void(*callback)(struct discord *client, const struct discord_message_reaction_remove *event))
 Triggers when a message reaction is removed. More...
 
void discord_set_on_message_reaction_remove_all (struct discord *client, void(*callback)(struct discord *client, const struct discord_message_reaction_remove_all *event))
 Triggers when all message reactions are removed. More...
 
void discord_set_on_message_reaction_remove_emoji (struct discord *client, void(*callback)(struct discord *client, const struct discord_message_reaction_remove_emoji *event))
 Triggers when all instances of a particular reaction from some message is removed. More...
 
void discord_set_on_presence_update (struct discord *client, void(*callback)(struct discord *client, const struct discord_presence_update *event))
 Triggers when user presence is updated. More...
 
void discord_set_on_stage_instance_create (struct discord *client, void(*callback)(struct discord *client, const struct discord_stage_instance *event))
 Triggers when a stage instance is created. More...
 
void discord_set_on_stage_instance_update (struct discord *client, void(*callback)(struct discord *client, const struct discord_stage_instance *event))
 Triggers when a stage instance is updated. More...
 
void discord_set_on_stage_instance_delete (struct discord *client, void(*callback)(struct discord *client, const struct discord_stage_instance *event))
 Triggers when a stage instance is deleted. More...
 
void discord_set_on_typing_start (struct discord *client, void(*callback)(struct discord *client, const struct discord_typing_start *event))
 Triggers when user starts typing in a channel. More...
 
void discord_set_on_user_update (struct discord *client, void(*callback)(struct discord *client, const struct discord_user *event))
 Triggers when properties about a user changed. More...
 
void discord_set_on_voice_state_update (struct discord *client, void(*callback)(struct discord *client, const struct discord_voice_state *event))
 Triggers when a voice state is updated. More...
 
void discord_set_on_voice_server_update (struct discord *client, void(*callback)(struct discord *client, const struct discord_voice_server_update *event))
 Triggers when voice server is updated. More...
 
void discord_set_on_webhooks_update (struct discord *client, void(*callback)(struct discord *client, const struct discord_webhooks_update *event))
 Triggers when guild channel has been created, updated or deleted. More...
 

Detailed Description

Events sent over the Gateway socket to the client.

Typedef Documentation

◆ discord_event_scheduler_t

◆ discord_ev_scheduler

typedef enum discord_event_scheduler(* discord_ev_scheduler) (struct discord *client, const char data[], size_t size, enum discord_gateway_events event)

Event Handling Mode callback.

A very important callback that enables the user with a fine-grained control of how each event is handled: blocking, non-blocking or ignored

See also
discord_set_event_scheduler(), discord_gateway_events

Enumeration Type Documentation

◆ discord_gateway_events

Discord Gateway's events.

Enumerator
DISCORD_EV_NONE 

missing event

DISCORD_EV_READY 
DISCORD_EV_RESUMED 
DISCORD_EV_RECONNECT 
DISCORD_EV_INVALID_SESSION 
DISCORD_EV_APPLICATION_COMMAND_PERMISSIONS_UPDATE 
DISCORD_EV_AUTO_MODERATION_RULE_CREATE 
DISCORD_EV_AUTO_MODERATION_RULE_UPDATE 
DISCORD_EV_AUTO_MODERATION_RULE_DELETE 
DISCORD_EV_AUTO_MODERATION_ACTION_EXECUTION 
DISCORD_EV_CHANNEL_CREATE 
DISCORD_EV_CHANNEL_UPDATE 
DISCORD_EV_CHANNEL_DELETE 
DISCORD_EV_CHANNEL_PINS_UPDATE 
DISCORD_EV_THREAD_CREATE 
DISCORD_EV_THREAD_UPDATE 
DISCORD_EV_THREAD_DELETE 
DISCORD_EV_THREAD_LIST_SYNC 
DISCORD_EV_THREAD_MEMBER_UPDATE 
DISCORD_EV_THREAD_MEMBERS_UPDATE 
DISCORD_EV_GUILD_CREATE 
DISCORD_EV_GUILD_UPDATE 
DISCORD_EV_GUILD_DELETE 
DISCORD_EV_GUILD_BAN_ADD 
DISCORD_EV_GUILD_BAN_REMOVE 
DISCORD_EV_GUILD_EMOJIS_UPDATE 
DISCORD_EV_GUILD_STICKERS_UPDATE 
DISCORD_EV_GUILD_INTEGRATIONS_UPDATE 
DISCORD_EV_GUILD_MEMBER_ADD 
DISCORD_EV_GUILD_MEMBER_REMOVE 
DISCORD_EV_GUILD_MEMBER_UPDATE 
DISCORD_EV_GUILD_MEMBERS_CHUNK 
DISCORD_EV_GUILD_ROLE_CREATE 
DISCORD_EV_GUILD_ROLE_UPDATE 
DISCORD_EV_GUILD_ROLE_DELETE 
DISCORD_EV_GUILD_SCHEDULED_EVENT_CREATE 
DISCORD_EV_GUILD_SCHEDULED_EVENT_UPDATE 
DISCORD_EV_GUILD_SCHEDULED_EVENT_DELETE 
DISCORD_EV_GUILD_SCHEDULED_EVENT_USER_ADD 
DISCORD_EV_GUILD_SCHEDULED_EVENT_USER_REMOVE 
DISCORD_EV_INTEGRATION_CREATE 
DISCORD_EV_INTEGRATION_UPDATE 
DISCORD_EV_INTEGRATION_DELETE 
DISCORD_EV_INTERACTION_CREATE 
DISCORD_EV_INVITE_CREATE 
DISCORD_EV_INVITE_DELETE 
DISCORD_EV_MESSAGE_CREATE 
DISCORD_EV_MESSAGE_UPDATE 
DISCORD_EV_MESSAGE_DELETE 
DISCORD_EV_MESSAGE_DELETE_BULK 
DISCORD_EV_MESSAGE_REACTION_ADD 
DISCORD_EV_MESSAGE_REACTION_REMOVE 
DISCORD_EV_MESSAGE_REACTION_REMOVE_ALL 
DISCORD_EV_MESSAGE_REACTION_REMOVE_EMOJI 
DISCORD_EV_PRESENCE_UPDATE 
DISCORD_EV_STAGE_INSTANCE_CREATE 
DISCORD_EV_STAGE_INSTANCE_DELETE 
DISCORD_EV_STAGE_INSTANCE_UPDATE 
DISCORD_EV_TYPING_START 
DISCORD_EV_USER_UPDATE 
DISCORD_EV_VOICE_STATE_UPDATE 
DISCORD_EV_VOICE_SERVER_UPDATE 
DISCORD_EV_WEBHOOKS_UPDATE 
DISCORD_EV_MAX 

total amount of enumerators

◆ discord_event_scheduler

return value of discord_set_event_scheduler() callback

See also
discord_set_event_scheduler()
Enumerator
DISCORD_EVENT_IGNORE 

this event has been handled

DISCORD_EVENT_MAIN_THREAD 

handle this event in main thread

DISCORD_EVENT_WORKER_THREAD 

handle this event in a worker thread

Deprecated:
functionality will be removed in the future

Function Documentation

◆ discord_set_event_scheduler()

void discord_set_event_scheduler ( struct discord client,
discord_ev_scheduler  callback 
)

Provides control over Discord event's callback scheduler.

See also
discord_event_scheduler, discord_gateway_events

Allows the user to scan the preliminary raw JSON event payload, and control whether it should trigger callbacks

Parameters
clientthe client created_with discord_init()
fnthe function that will be executed
Warning
The user is responsible for providing their own locking mechanism to avoid race-condition on sensitive data

◆ discord_add_intents()

void discord_add_intents ( struct discord client,
uint64_t  code 
)

Subscribe to Discord Events.

Parameters
clientthe client created with discord_init()
codethe intents opcode, can be set as a bitmask operation
Examples
audit-log.c, cache.c, and manual-dm.c.

◆ discord_remove_intents()

void discord_remove_intents ( struct discord client,
uint64_t  code 
)

Unsubscribe from Discord Events.

Parameters
clientthe client created with discord_init()
codethe intents opcode, can be set as bitmask operation Ex: 1 << 0 | 1 << 1 | 1 << 4
Examples
manual-dm.c.

◆ discord_set_prefix()

void discord_set_prefix ( struct discord client,
const char  prefix[] 
)

Set a mandatory prefix before commands.

See also
discord_set_on_command()

Example: If 'help' is a command and '!' prefix is set, the command will only be validated if '!help' is sent

Parameters
clientthe client created with discord_init()
prefixthe mandatory command prefix
Examples
channel.c, components.c, embed.c, emoji.c, guild-template.c, guild.c, invite.c, pin.c, and reaction.c.

◆ discord_set_on_command()

void discord_set_on_command ( struct discord client,
char *  command,
void(*)(struct discord *client, const struct discord_message *event)  callback 
)

Set command/callback pair.

The callback is triggered when a user types the assigned command in a chat visible to the client

Parameters
clientthe client created with discord_init()
commandthe command to trigger the callback
callbackthe callback to be triggered on event
Note
The command and any subjacent empty space is left out of the message content
Examples
audit-log.c, ban.c, channel.c, components.c, embed.c, emoji.c, guild-template.c, guild.c, invite.c, pin.c, reaction.c, and slash-commands.c.

◆ discord_set_on_commands()

void discord_set_on_commands ( struct discord client,
char *const  commands[],
int  amount,
void(*)(struct discord *client, const struct discord_message *event)  callback 
)

Set a variadic series of NULL terminated commands to a callback.

The callback is triggered when a user types one of the assigned commands in a chat visble to the client

Parameters
clientthe client created with discord_init()
commandsarray of commands to trigger the callback
amountamount of commands provided
callbackthe callback to be triggered on event
Note
The command and any subjacent empty space is left out of the message content

◆ discord_set_next_wakeup()

void discord_set_next_wakeup ( struct discord client,
int64_t  delay 
)

Set the time for wakeup function to be called.

See also
discord_set_on_wakeup
Deprecated:
since v2.1.0, rely on Timer instead
Parameters
delaytime to delay in milliseconds, or -1 to disable

◆ discord_set_on_wakeup()

void discord_set_on_wakeup ( struct discord client,
void(*)(struct discord *client)  callback 
)

Triggered at a arbitrary interval value set at discord_set_next_wakeup()

Note
This is a Concord custom event
Deprecated:
since v2.1.0, rely on Timer instead
Parameters
clientthe client created with discord_init()
callbackthe callback to be triggered on event

◆ discord_set_on_idle()

void discord_set_on_idle ( struct discord client,
void(*)(struct discord *client)  callback 
)

Triggers when idle.

Note
This is a Concord custom event
Parameters
clientthe client created with discord_init()
callbackthe callback to be triggered on event

◆ discord_set_on_cycle()

void discord_set_on_cycle ( struct discord client,
void(*)(struct discord *client)  callback 
)

Triggers once per event-loop cycle.

Note
This is a Concord custom event
Parameters
clientthe client created with discord_init()
callbackthe callback to be triggered on event

◆ discord_set_on_ready()

void discord_set_on_ready ( struct discord client,
void(*)(struct discord *client, const struct discord_ready *event)  callback 
)

Triggers when the client session is ready.

Parameters
clientthe client created with discord_init()
callbackthe callback to be triggered on event
Examples
audit-log.c, ban.c, channel.c, components.c, embed.c, emoji.c, guild-template.c, guild.c, invite.c, manual-dm.c, pin.c, reaction.c, slash-commands.c, and slash-commands2.c.

◆ discord_set_on_application_command_permissions_update()

void discord_set_on_application_command_permissions_update ( struct discord client,
void(*)(struct discord *client, const struct discord_application_command_permissions *event)  callback 
)

Triggers when an application command permission is updated.

Parameters
clientthe client created with discord_init()
callbackthe callback to be triggered on event

◆ discord_set_on_auto_moderation_rule_create()

void discord_set_on_auto_moderation_rule_create ( struct discord client,
void(*)(struct discord *client, const struct discord_auto_moderation_rule *event)  callback 
)

Triggers when an auto moderation rule is created.

Note
This implicitly sets DISCORD_GATEWAY_AUTO_MODERATION_CONFIGURATION intent
Parameters
clientthe client created with discord_init()
callbackthe callback to be triggered on event

◆ discord_set_on_auto_moderation_rule_update()

void discord_set_on_auto_moderation_rule_update ( struct discord client,
void(*)(struct discord *client, const struct discord_auto_moderation_rule *event)  callback 
)

Triggers when an auto moderation rule is updated.

Note
This implicitly sets DISCORD_GATEWAY_AUTO_MODERATION_CONFIGURATION intent
Parameters
clientthe client created with discord_init()
callbackthe callback to be triggered on event

◆ discord_set_on_auto_moderation_rule_delete()

void discord_set_on_auto_moderation_rule_delete ( struct discord client,
void(*)(struct discord *client, const struct discord_auto_moderation_rule *event)  callback 
)

Triggers when an auto moderation rule is deleted.

Note
This implicitly sets DISCORD_GATEWAY_AUTO_MODERATION_CONFIGURATION intent
Parameters
clientthe client created with discord_init()
callbackthe callback to be triggered on event

◆ discord_set_on_auto_moderation_action_execution()

void discord_set_on_auto_moderation_action_execution ( struct discord client,
void(*)(struct discord *client, const struct discord_auto_moderation_action_execution *event)  callback 
)

Triggers when an auto moderation rule is triggered and an execution is executed (e.g a message was blocked)

Note
This implicitly sets DISCORD_GATEWAY_AUTO_MODERATION_EXECUTION intent
Parameters
clientthe client created with discord_init()
callbackthe callback to be triggered on event

◆ discord_set_on_channel_create()

void discord_set_on_channel_create ( struct discord client,
void(*)(struct discord *client, const struct discord_channel *event)  callback 
)

Triggers when a channel is created.

Note
This implicitly sets DISCORD_GATEWAY_GUILDS intent
Parameters
clientthe client created with discord_init()
callbackthe callback to be triggered on event
Examples
channel.c.

◆ discord_set_on_channel_update()

void discord_set_on_channel_update ( struct discord client,
void(*)(struct discord *client, const struct discord_channel *event)  callback 
)

Triggers when a channel is updated.

Note
This implicitly sets DISCORD_GATEWAY_GUILDS intent
Parameters
clientthe client created with discord_init()
callbackthe callback to be triggered on event
Examples
channel.c.

◆ discord_set_on_channel_delete()

void discord_set_on_channel_delete ( struct discord client,
void(*)(struct discord *client, const struct discord_channel *event)  callback 
)

Triggers when a channel is deleted.

Note
This implicitly sets DISCORD_GATEWAY_GUILDS intent
Parameters
clientthe client created with discord_init()
callbackthe callback to be triggered on event
Examples
channel.c.

◆ discord_set_on_channel_pins_update()

void discord_set_on_channel_pins_update ( struct discord client,
void(*)(struct discord *client, const struct discord_channel_pins_update *event)  callback 
)

Triggers when a channel pin is updated.

Note
This implicitly sets DISCORD_GATEWAY_GUILDS and DISCORD_GATEWAY_DIRECT_MESSAGES intents
Parameters
clientthe client created with discord_init()
callbackthe callback to be triggered on event

◆ discord_set_on_thread_create()

void discord_set_on_thread_create ( struct discord client,
void(*)(struct discord *client, const struct discord_channel *event)  callback 
)

Triggers when a thread is created.

Note
This implicitly sets DISCORD_GATEWAY_GUILDS intent
Parameters
clientthe client created with discord_init()
callbackthe callback to be triggered on event
Examples
channel.c.

◆ discord_set_on_thread_update()

void discord_set_on_thread_update ( struct discord client,
void(*)(struct discord *client, const struct discord_channel *event)  callback 
)

Triggers when a thread is updated.

Note
This implicitly sets DISCORD_GATEWAY_GUILDS intent
Parameters
clientthe client created with discord_init()
callbackthe callback to be triggered on event
Examples
channel.c.

◆ discord_set_on_thread_delete()

void discord_set_on_thread_delete ( struct discord client,
void(*)(struct discord *client, const struct discord_channel *event)  callback 
)

Triggers when a thread is deleted.

Note
This implicitly sets DISCORD_GATEWAY_GUILDS intent
Parameters
clientthe client created with discord_init()
callbackthe callback to be triggered on event
Examples
channel.c.

◆ discord_set_on_thread_list_sync()

void discord_set_on_thread_list_sync ( struct discord client,
void(*)(struct discord *client, const struct discord_thread_list_sync *event)  callback 
)

Triggers when the current user gains access to a channel.

Note
This implicitly sets DISCORD_GATEWAY_GUILDS intent
Parameters
clientthe client created with discord_init()
callbackthe callback to be triggered on event

◆ discord_set_on_thread_member_update()

void discord_set_on_thread_member_update ( struct discord client,
void(*)(struct discord *client, const struct discord_thread_member *event)  callback 
)

Triggers when a thread the bot is in gets updated.

Note
For bots, this event largely is just a signal that you are a member of the thread
This implicitly sets DISCORD_GATEWAY_GUILDS intent
Parameters
clientthe client created with discord_init()
callbackthe callback to be triggered on event

◆ discord_set_on_thread_members_update()

void discord_set_on_thread_members_update ( struct discord client,
void(*)(struct discord *client, const struct discord_thread_members_update *event)  callback 
)

Triggers when someone is added or removed from a thread.

Note
This implicitly sets DISCORD_GATEWAY_GUILDS and DISCORD_GATEWAY_GUILD_MEMBERS intents
Parameters
clientthe client created with discord_init()
callbackthe callback to be triggered on event

◆ discord_set_on_guild_create()

void discord_set_on_guild_create ( struct discord client,
void(*)(struct discord *client, const struct discord_guild *event)  callback 
)

Triggers when a guild is created.

Note
This implicitly sets DISCORD_GATEWAY_GUILDS intent
Parameters
clientthe client created with discord_init()
callbackthe callback to be triggered on event

◆ discord_set_on_guild_update()

void discord_set_on_guild_update ( struct discord client,
void(*)(struct discord *client, const struct discord_guild *event)  callback 
)

Triggers when a guild is updated.

Note
This implicitly sets DISCORD_GATEWAY_GUILDS intent
Parameters
clientthe client created with discord_init()
callbackthe callback to be triggered on event

◆ discord_set_on_guild_delete()

void discord_set_on_guild_delete ( struct discord client,
void(*)(struct discord *client, const struct discord_guild *event)  callback 
)

Triggers when a guild is deleted.

Note
This implicitly sets DISCORD_GATEWAY_GUILDS intent
Parameters
clientthe client created with discord_init()
callbackthe callback to be triggered on event

◆ discord_set_on_guild_ban_add()

void discord_set_on_guild_ban_add ( struct discord client,
void(*)(struct discord *client, const struct discord_guild_ban_add *event)  callback 
)

Triggers when a user is banned from a guild.

Note
This implicitly sets DISCORD_GATEWAY_GUILD_BANS intent
Parameters
clientthe client created with discord_init()
callbackthe callback to be triggered on event
Examples
ban.c.

◆ discord_set_on_guild_ban_remove()

void discord_set_on_guild_ban_remove ( struct discord client,
void(*)(struct discord *client, const struct discord_guild_ban_remove *event)  callback 
)

Triggers when a user is unbanned from a guild.

Note
This implicitly sets DISCORD_GATEWAY_GUILD_BANS intent
Parameters
clientthe client created with discord_init()
callbackthe callback to be triggered on event
Examples
ban.c.

◆ discord_set_on_guild_emojis_update()

void discord_set_on_guild_emojis_update ( struct discord client,
void(*)(struct discord *client, const struct discord_guild_emojis_update *event)  callback 
)

Triggers when a guild emojis are updated.

Note
This implicitly sets DISCORD_GATEWAY_GUILD_EMOJIS_AND_STICKERS intent
Parameters
clientthe client created with discord_init()
callbackthe callback to be triggered on event

◆ discord_set_on_guild_stickers_update()

void discord_set_on_guild_stickers_update ( struct discord client,
void(*)(struct discord *client, const struct discord_guild_stickers_update *event)  callback 
)

Triggers when a guild stickers are updated.

Note
This implicitly sets DISCORD_GATEWAY_GUILD_EMOJIS_AND_STICKERS intent
Parameters
clientthe client created with discord_init()
callbackthe callback to be triggered on event

◆ discord_set_on_guild_integrations_update()

void discord_set_on_guild_integrations_update ( struct discord client,
void(*)(struct discord *client, const struct discord_guild_integrations_update *event)  callback 
)

Triggers when a guild integrations are updated.

Note
This implicitly sets DISCORD_GATEWAY_GUILD_INTEGRATIONS intent
Parameters
clientthe client created with discord_init()
callbackthe callback to be triggered on event

◆ discord_set_on_guild_member_add()

void discord_set_on_guild_member_add ( struct discord client,
void(*)(struct discord *client, const struct discord_guild_member *event)  callback 
)

Triggers when a guild member is added.

Note
This implicitly sets DISCORD_GATEWAY_GUILD_MEMBERS intent
Parameters
clientthe client created with discord_init()
callbackthe callback to be triggered on event
Examples
audit-log.c.

◆ discord_set_on_guild_member_update()

void discord_set_on_guild_member_update ( struct discord client,
void(*)(struct discord *client, const struct discord_guild_member_update *event)  callback 
)

Triggers when a guild member is updated.

Note
This implicitly sets DISCORD_GATEWAY_GUILD_MEMBERS intent
Parameters
clientthe client created with discord_init()
callbackthe callback to be triggered on event
Examples
audit-log.c.

◆ discord_set_on_guild_member_remove()

void discord_set_on_guild_member_remove ( struct discord client,
void(*)(struct discord *client, const struct discord_guild_member_remove *event)  callback 
)

Triggers when a guild member is removed.

Note
This implicitly sets DISCORD_GATEWAY_GUILD_MEMBERS intent
Parameters
clientthe client created with discord_init()
callbackthe callback to be triggered on event
Examples
audit-log.c.

◆ discord_set_on_guild_members_chunk()

void discord_set_on_guild_members_chunk ( struct discord client,
void(*)(struct discord *client, const struct discord_guild_members_chunk *event)  callback 
)

Triggers in response to discord_request_guild_members()

Parameters
clientthe client created with discord_init()
callbackthe callback to be triggered on event

◆ discord_set_on_guild_role_create()

void discord_set_on_guild_role_create ( struct discord client,
void(*)(struct discord *client, const struct discord_guild_role_create *event)  callback 
)

Triggers when a guild role is created.

Note
This implicitly sets DISCORD_GATEWAY_GUILDS intent
Parameters
clientthe client created with discord_init()
callbackthe callback to be triggered on event
Examples
guild.c.

◆ discord_set_on_guild_role_update()

void discord_set_on_guild_role_update ( struct discord client,
void(*)(struct discord *client, const struct discord_guild_role_update *event)  callback 
)

Triggers when a guild role is updated.

Note
This implicitly sets DISCORD_GATEWAY_GUILDS intent
Parameters
clientthe client created with discord_init()
callbackthe callback to be triggered on event
Examples
guild.c.

◆ discord_set_on_guild_role_delete()

void discord_set_on_guild_role_delete ( struct discord client,
void(*)(struct discord *client, const struct discord_guild_role_delete *event)  callback 
)

Triggers when a guild role is deleted.

Note
This implicitly sets DISCORD_GATEWAY_GUILDS intent
Parameters
clientthe client created with discord_init()
callbackthe callback to be triggered on event
Examples
guild.c.

◆ discord_set_on_guild_scheduled_event_create()

void discord_set_on_guild_scheduled_event_create ( struct discord client,
void(*)(struct discord *client, const struct discord_guild_scheduled_event *event)  callback 
)

Triggers when a guild scheduled event is created.

Note
This implicitly sets DISCORD_GATEWAY_GUILD_SCHEDULED_EVENTS intent
Parameters
clientthe client created with discord_init()
callbackthe callback to be triggered on event

◆ discord_set_on_guild_scheduled_event_update()

void discord_set_on_guild_scheduled_event_update ( struct discord client,
void(*)(struct discord *client, const struct discord_guild_scheduled_event *event)  callback 
)

Triggers when a guild scheduled event is updated.

Note
This implicitly sets DISCORD_GATEWAY_GUILD_SCHEDULED_EVENTS intent
Parameters
clientthe client created with discord_init()
callbackthe callback to be triggered on event

◆ discord_set_on_guild_scheduled_event_delete()

void discord_set_on_guild_scheduled_event_delete ( struct discord client,
void(*)(struct discord *client, const struct discord_guild_scheduled_event *event)  callback 
)

Triggers when a guild scheduled event is deleted.

Note
This implicitly sets DISCORD_GATEWAY_GUILD_SCHEDULED_EVENTS intent
Parameters
clientthe client created with discord_init()
callbackthe callback to be triggered on event

◆ discord_set_on_guild_scheduled_event_user_add()

void discord_set_on_guild_scheduled_event_user_add ( struct discord client,
void(*)(struct discord *client, const struct discord_guild_scheduled_event_user_add *event)  callback 
)

Triggers when a user subscribes to a guild scheduled event.

Note
This implicitly sets DISCORD_GATEWAY_GUILD_SCHEDULED_EVENTS intent
Parameters
clientthe client created with discord_init()
callbackthe callback to be triggered on event

◆ discord_set_on_guild_scheduled_event_user_remove()

void discord_set_on_guild_scheduled_event_user_remove ( struct discord client,
void(*)(struct discord *client, const struct discord_guild_scheduled_event_user_remove *event)  callback 
)

Triggers when a user unsubscribes from a guild scheduled event.

Note
This implicitly sets DISCORD_GATEWAY_GUILD_SCHEDULED_EVENTS intent
Parameters
clientthe client created with discord_init()
callbackthe callback to be triggered on event

◆ discord_set_on_integration_create()

void discord_set_on_integration_create ( struct discord client,
void(*)(struct discord *client, const struct discord_integration *event)  callback 
)

Triggers when a guild integration is created.

Note
This implicitly sets DISCORD_GATEWAY_GUILD_INTEGRATIONS intent
Parameters
clientthe client created with discord_init()
callbackthe callback to be triggered on event

◆ discord_set_on_integration_update()

void discord_set_on_integration_update ( struct discord client,
void(*)(struct discord *client, const struct discord_integration *event)  callback 
)

Triggers when a guild integration is updated.

Note
This implicitly sets DISCORD_GATEWAY_GUILD_INTEGRATIONS intent
Parameters
clientthe client created with discord_init()
callbackthe callback to be triggered on event

◆ discord_set_on_integration_delete()

void discord_set_on_integration_delete ( struct discord client,
void(*)(struct discord *client, const struct discord_integration_delete *event)  callback 
)

Triggers when a guild integration is deleted.

Note
This implicitly sets DISCORD_GATEWAY_GUILD_INTEGRATIONS intent
Parameters
clientthe client created with discord_init()
callbackthe callback to be triggered on event

◆ discord_set_on_interaction_create()

void discord_set_on_interaction_create ( struct discord client,
void(*)(struct discord *client, const struct discord_interaction *event)  callback 
)

Triggers when user has used an interaction, such as an application command.

Parameters
clientthe client created with discord_init()
callbackthe callback to be triggered on event
Examples
components.c, slash-commands.c, and slash-commands2.c.

◆ discord_set_on_invite_create()

void discord_set_on_invite_create ( struct discord client,
void(*)(struct discord *client, const struct discord_invite_create *event)  callback 
)

Triggers when an invite to a channel has been created.

Note
This implicitly sets DISCORD_GATEWAY_GUILD_INVITES intent
Parameters
clientthe client created with discord_init()
callbackthe callback to be triggered on event

◆ discord_set_on_invite_delete()

void discord_set_on_invite_delete ( struct discord client,
void(*)(struct discord *client, const struct discord_invite_delete *event)  callback 
)

Triggers when an invite to a channel has been deleted.

Note
This implicitly sets DISCORD_GATEWAY_GUILD_INVITES intent
Parameters
clientthe client created with discord_init()
callbackthe callback to be triggered on event

◆ discord_set_on_message_create()

void discord_set_on_message_create ( struct discord client,
void(*)(struct discord *client, const struct discord_message *event)  callback 
)

Triggers when a message is created.

Note
This implicitly sets DISCORD_GATEWAY_GUILD_MESSAGES and DISCORD_GATEWAY_DIRECT_MESSAGES intents
Parameters
clientthe client created with discord_init()
callbackthe callback to be triggered on event
Examples
cache.c, and manual-dm.c.

◆ discord_set_on_message_update()

void discord_set_on_message_update ( struct discord client,
void(*)(struct discord *client, const struct discord_message *event)  callback 
)

Triggers when a message is updated.

Note
This implicitly sets DISCORD_GATEWAY_GUILD_MESSAGES and DISCORD_GATEWAY_DIRECT_MESSAGES intents
Parameters
clientthe client created with discord_init()
callbackthe callback to be triggered on event

◆ discord_set_on_message_delete()

void discord_set_on_message_delete ( struct discord client,
void(*)(struct discord *client, const struct discord_message_delete *event)  callback 
)

Triggers when a message is deleted.

Note
This implicitly sets DISCORD_GATEWAY_GUILD_MESSAGES and DISCORD_GATEWAY_DIRECT_MESSAGES intents
Parameters
clientthe client created with discord_init()
callbackthe callback to be triggered on event

◆ discord_set_on_message_delete_bulk()

void discord_set_on_message_delete_bulk ( struct discord client,
void(*)(struct discord *client, const struct discord_message_delete_bulk *event)  callback 
)

Triggers when messages are deleted in bulk.

Note
This implicitly sets DISCORD_GATEWAY_GUILD_MESSAGES intent
Parameters
clientthe client created with discord_init()
callbackthe callback to be triggered on event

◆ discord_set_on_message_reaction_add()

void discord_set_on_message_reaction_add ( struct discord client,
void(*)(struct discord *client, const struct discord_message_reaction_add *event)  callback 
)

Triggers when a message reaction is added.

Note
This implicitly sets DISCORD_GATEWAY_GUILD_MESSAGE_REACTIONS and DISCORD_GATEWAY_DIRECT_MESSAGE_REACTIONS intents
Parameters
clientthe client created with discord_init()
callbackthe callback to be triggered on event

◆ discord_set_on_message_reaction_remove()

void discord_set_on_message_reaction_remove ( struct discord client,
void(*)(struct discord *client, const struct discord_message_reaction_remove *event)  callback 
)

Triggers when a message reaction is removed.

Note
This implicitly sets DISCORD_GATEWAY_GUILD_MESSAGE_REACTIONS and DISCORD_GATEWAY_DIRECT_MESSAGE_REACTIONS intents
Parameters
clientthe client created with discord_init()
callbackthe callback to be triggered on event

◆ discord_set_on_message_reaction_remove_all()

void discord_set_on_message_reaction_remove_all ( struct discord client,
void(*)(struct discord *client, const struct discord_message_reaction_remove_all *event)  callback 
)

Triggers when all message reactions are removed.

Note
This implicitly sets DISCORD_GATEWAY_GUILD_MESSAGE_REACTIONS and DISCORD_GATEWAY_DIRECT_MESSAGE_REACTIONS intents
Parameters
clientthe client created with discord_init()
callbackthe callback to be triggered on event

◆ discord_set_on_message_reaction_remove_emoji()

void discord_set_on_message_reaction_remove_emoji ( struct discord client,
void(*)(struct discord *client, const struct discord_message_reaction_remove_emoji *event)  callback 
)

Triggers when all instances of a particular reaction from some message is removed.

Triggers when all instances of a particular reaction is removed from a message

Note
This implicitly sets DISCORD_GATEWAY_GUILD_MESSAGE_REACTIONS and DISCORD_GATEWAY_DIRECT_MESSAGE_REACTIONS intents
Parameters
clientthe client created with discord_init()
callbackthe callback to be triggered on event

◆ discord_set_on_presence_update()

void discord_set_on_presence_update ( struct discord client,
void(*)(struct discord *client, const struct discord_presence_update *event)  callback 
)

Triggers when user presence is updated.

Note
This implicitly sets DISCORD_GATEWAY_GUILD_PRESENCES intent
Parameters
clientthe client created with discord_init()
callbackthe callback to be triggered on event

◆ discord_set_on_stage_instance_create()

void discord_set_on_stage_instance_create ( struct discord client,
void(*)(struct discord *client, const struct discord_stage_instance *event)  callback 
)

Triggers when a stage instance is created.

Note
This implicitly sets DISCORD_GATEWAY_GUILDS intent
Parameters
clientthe client created with discord_init()
callbackthe callback to be triggered on event

◆ discord_set_on_stage_instance_update()

void discord_set_on_stage_instance_update ( struct discord client,
void(*)(struct discord *client, const struct discord_stage_instance *event)  callback 
)

Triggers when a stage instance is updated.

Note
This implicitly sets DISCORD_GATEWAY_GUILDS intent
Parameters
clientthe client created with discord_init()
callbackthe callback to be triggered on event

◆ discord_set_on_stage_instance_delete()

void discord_set_on_stage_instance_delete ( struct discord client,
void(*)(struct discord *client, const struct discord_stage_instance *event)  callback 
)

Triggers when a stage instance is deleted.

Note
This implicitly sets DISCORD_GATEWAY_GUILDS intent
Parameters
clientthe client created with discord_init()
callbackthe callback to be triggered on event

◆ discord_set_on_typing_start()

void discord_set_on_typing_start ( struct discord client,
void(*)(struct discord *client, const struct discord_typing_start *event)  callback 
)

Triggers when user starts typing in a channel.

Note
This implicitly sets DISCORD_GATEWAY_GUILD_MESSAGE_TYPING and DISCORD_GATEWAY_DIRECT_MESSAGE_TYPING intents
Parameters
clientthe client created with discord_init()
callbackthe callback to be triggered on event

◆ discord_set_on_user_update()

void discord_set_on_user_update ( struct discord client,
void(*)(struct discord *client, const struct discord_user *event)  callback 
)

Triggers when properties about a user changed.

Parameters
clientthe client created with discord_init()
callbackthe callback to be triggered on event

◆ discord_set_on_voice_state_update()

void discord_set_on_voice_state_update ( struct discord client,
void(*)(struct discord *client, const struct discord_voice_state *event)  callback 
)

Triggers when a voice state is updated.

Parameters
clientthe client created with discord_init()
callbackthe callback to be triggered on event

◆ discord_set_on_voice_server_update()

void discord_set_on_voice_server_update ( struct discord client,
void(*)(struct discord *client, const struct discord_voice_server_update *event)  callback 
)

Triggers when voice server is updated.

Parameters
clientthe client created with discord_init()
callbackthe callback to be triggered on event

◆ discord_set_on_webhooks_update()

void discord_set_on_webhooks_update ( struct discord client,
void(*)(struct discord *client, const struct discord_webhooks_update *event)  callback 
)

Triggers when guild channel has been created, updated or deleted.

Note
This implicitly sets DISCORD_GATEWAY_GUILD_WEBHOOKS intent
Parameters
clientthe client created with discord_init()
callbackthe callback to be triggered on event