7#ifndef DISCORD_EVENTS_H
8#define DISCORD_EVENTS_H
217 void (*callback)(
struct discord *client,
236 void (*callback)(
struct discord *client,
258 void (*callback)(
struct discord *client));
268 void (*callback)(
struct discord *client));
278 void (*callback)(
struct discord *client));
287 void (*callback)(
struct discord *client,
312 void (*callback)(
struct discord *client,
325 void (*callback)(
struct discord *client,
338 void (*callback)(
struct discord *client,
365 void (*callback)(
struct discord *client,
377 void (*callback)(
struct discord *client,
389 void (*callback)(
struct discord *client,
402 void (*callback)(
struct discord *client,
414 void (*callback)(
struct discord *client,
426 void (*callback)(
struct discord *client,
438 void (*callback)(
struct discord *client,
450 void (*callback)(
struct discord *client,
464 void (*callback)(
struct discord *client,
477 void (*callback)(
struct discord *client,
489 void (*callback)(
struct discord *client,
501 void (*callback)(
struct discord *client,
513 void (*callback)(
struct discord *client,
525 void (*callback)(
struct discord *client,
537 void (*callback)(
struct discord *client,
550 void (*callback)(
struct discord *client,
563 void (*callback)(
struct discord *client,
576 void (*callback)(
struct discord *client,
588 void (*callback)(
struct discord *client,
600 void (*callback)(
struct discord *client,
612 void (*callback)(
struct discord *client,
623 void (*callback)(
struct discord *client,
635 void (*callback)(
struct discord *client,
647 void (*callback)(
struct discord *client,
659 void (*callback)(
struct discord *client,
672 void (*callback)(
struct discord *client,
685 void (*callback)(
struct discord *client,
698 void (*callback)(
struct discord *client,
739 void (*callback)(
struct discord *client,
752 void (*callback)(
struct discord *client,
765 void (*callback)(
struct discord *client,
777 void (*callback)(
struct discord *client,
789 void (*callback)(
struct discord *client,
801 void (*callback)(
struct discord *client,
814 void (*callback)(
struct discord *client,
827 void (*callback)(
struct discord *client,
840 void (*callback)(
struct discord *client,
853 void (*callback)(
struct discord *client,
867 void (*callback)(
struct discord *client,
881 void (*callback)(
struct discord *client,
895 void (*callback)(
struct discord *client,
925 void (*callback)(
struct discord *client,
937 void (*callback)(
struct discord *client,
949 void (*callback)(
struct discord *client,
961 void (*callback)(
struct discord *client,
974 void (*callback)(
struct discord *client,
985 void (*callback)(
struct discord *client,
996 void (*callback)(
struct discord *client,
1007 void (*callback)(
struct discord *client,
1019 void (*callback)(
struct discord *client,
void discord_update_voice_state(struct discord *client, struct discord_update_voice_state *update)
Sent when a client wants to join, move or disconnect from a voice channel.
void discord_request_guild_members(struct discord *client, struct discord_request_guild_members *request)
Request all members for a guild or a list of guilds.
void discord_set_presence(struct discord *client, struct discord_presence_update *presence)
Set the client presence status.
void discord_update_presence(struct discord *client, struct discord_presence_update *presence)
Update the client presence status.
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.
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.
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.
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.
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.
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.
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.
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.
void discord_add_intents(struct discord *client, uint64_t code)
Subscribe to Discord Events.
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.
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.
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.
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.
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.
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.
void discord_remove_intents(struct discord *client, uint64_t code)
Unsubscribe from Discord Events.
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.
void discord_set_next_wakeup(struct discord *client, int64_t delay)
Set the time for wakeup function to be called.
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....
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.
void discord_set_prefix(struct discord *client, const char prefix[])
Set a mandatory prefix before commands.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
void discord_set_on_idle(struct discord *client, void(*callback)(struct discord *client))
Triggers when idle.
enum discord_event_scheduler discord_event_scheduler_t
return value of discord_set_event_scheduler() callback
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.
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.
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.
discord_gateway_events
Discord Gateway's events.
Definition: discord-events.h:65
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
void discord_set_on_cycle(struct discord *client, void(*callback)(struct discord *client))
Triggers once per event-loop cycle.
void discord_set_on_command(struct discord *client, char *command, void(*callback)(struct discord *client, const struct discord_message *event))
Set command/callback pair.
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.
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.
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()
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.
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.
discord_event_scheduler
return value of discord_set_event_scheduler() callback
Definition: discord-events.h:136
void discord_set_event_scheduler(struct discord *client, discord_ev_scheduler callback)
Provides control over Discord event's callback scheduler.
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.
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.
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.
Definition: discord-events.h:155
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.
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.
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.
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.
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.
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()
@ DISCORD_EV_GUILD_SCHEDULED_EVENT_USER_ADD
Definition: discord-events.h:104
@ DISCORD_EV_GUILD_MEMBER_REMOVE
Definition: discord-events.h:95
@ DISCORD_EV_GUILD_DELETE
Definition: discord-events.h:88
@ DISCORD_EV_INVITE_CREATE
Definition: discord-events.h:110
@ DISCORD_EV_MESSAGE_DELETE_BULK
Definition: discord-events.h:115
@ DISCORD_EV_MESSAGE_DELETE
Definition: discord-events.h:114
@ DISCORD_EV_RECONNECT
Definition: discord-events.h:69
@ DISCORD_EV_GUILD_INTEGRATIONS_UPDATE
Definition: discord-events.h:93
@ DISCORD_EV_RESUMED
Definition: discord-events.h:68
@ DISCORD_EV_MAX
Definition: discord-events.h:129
@ DISCORD_EV_GUILD_BAN_ADD
Definition: discord-events.h:89
@ DISCORD_EV_GUILD_MEMBER_UPDATE
Definition: discord-events.h:96
@ DISCORD_EV_TYPING_START
Definition: discord-events.h:124
@ DISCORD_EV_GUILD_CREATE
Definition: discord-events.h:86
@ DISCORD_EV_NONE
Definition: discord-events.h:66
@ DISCORD_EV_THREAD_CREATE
Definition: discord-events.h:80
@ DISCORD_EV_GUILD_ROLE_UPDATE
Definition: discord-events.h:99
@ DISCORD_EV_GUILD_SCHEDULED_EVENT_DELETE
Definition: discord-events.h:103
@ DISCORD_EV_GUILD_ROLE_CREATE
Definition: discord-events.h:98
@ DISCORD_EV_THREAD_MEMBERS_UPDATE
Definition: discord-events.h:85
@ DISCORD_EV_THREAD_LIST_SYNC
Definition: discord-events.h:83
@ DISCORD_EV_GUILD_BAN_REMOVE
Definition: discord-events.h:90
@ DISCORD_EV_VOICE_STATE_UPDATE
Definition: discord-events.h:126
@ DISCORD_EV_INTERACTION_CREATE
Definition: discord-events.h:109
@ DISCORD_EV_CHANNEL_DELETE
Definition: discord-events.h:78
@ DISCORD_EV_USER_UPDATE
Definition: discord-events.h:125
@ DISCORD_EV_INTEGRATION_UPDATE
Definition: discord-events.h:107
@ DISCORD_EV_STAGE_INSTANCE_UPDATE
Definition: discord-events.h:123
@ DISCORD_EV_THREAD_DELETE
Definition: discord-events.h:82
@ DISCORD_EV_GUILD_ROLE_DELETE
Definition: discord-events.h:100
@ DISCORD_EV_GUILD_STICKERS_UPDATE
Definition: discord-events.h:92
@ DISCORD_EV_GUILD_SCHEDULED_EVENT_USER_REMOVE
Definition: discord-events.h:105
@ DISCORD_EV_STAGE_INSTANCE_DELETE
Definition: discord-events.h:122
@ DISCORD_EV_THREAD_UPDATE
Definition: discord-events.h:81
@ DISCORD_EV_MESSAGE_UPDATE
Definition: discord-events.h:113
@ DISCORD_EV_PRESENCE_UPDATE
Definition: discord-events.h:120
@ DISCORD_EV_CHANNEL_UPDATE
Definition: discord-events.h:77
@ DISCORD_EV_AUTO_MODERATION_ACTION_EXECUTION
Definition: discord-events.h:75
@ DISCORD_EV_INTEGRATION_CREATE
Definition: discord-events.h:106
@ DISCORD_EV_INVALID_SESSION
Definition: discord-events.h:70
@ DISCORD_EV_INTEGRATION_DELETE
Definition: discord-events.h:108
@ DISCORD_EV_APPLICATION_COMMAND_PERMISSIONS_UPDATE
Definition: discord-events.h:71
@ DISCORD_EV_MESSAGE_CREATE
Definition: discord-events.h:112
@ DISCORD_EV_CHANNEL_PINS_UPDATE
Definition: discord-events.h:79
@ DISCORD_EV_MESSAGE_REACTION_REMOVE
Definition: discord-events.h:117
@ DISCORD_EV_GUILD_MEMBERS_CHUNK
Definition: discord-events.h:97
@ DISCORD_EV_WEBHOOKS_UPDATE
Definition: discord-events.h:128
@ DISCORD_EV_AUTO_MODERATION_RULE_CREATE
Definition: discord-events.h:72
@ DISCORD_EV_MESSAGE_REACTION_REMOVE_EMOJI
Definition: discord-events.h:119
@ DISCORD_EV_INVITE_DELETE
Definition: discord-events.h:111
@ DISCORD_EV_GUILD_EMOJIS_UPDATE
Definition: discord-events.h:91
@ DISCORD_EV_CHANNEL_CREATE
Definition: discord-events.h:76
@ DISCORD_EV_GUILD_UPDATE
Definition: discord-events.h:87
@ DISCORD_EV_GUILD_SCHEDULED_EVENT_CREATE
Definition: discord-events.h:101
@ DISCORD_EV_GUILD_MEMBER_ADD
Definition: discord-events.h:94
@ DISCORD_EV_THREAD_MEMBER_UPDATE
Definition: discord-events.h:84
@ DISCORD_EV_MESSAGE_REACTION_ADD
Definition: discord-events.h:116
@ DISCORD_EV_AUTO_MODERATION_RULE_DELETE
Definition: discord-events.h:74
@ DISCORD_EV_STAGE_INSTANCE_CREATE
Definition: discord-events.h:121
@ DISCORD_EV_GUILD_SCHEDULED_EVENT_UPDATE
Definition: discord-events.h:102
@ DISCORD_EV_READY
Definition: discord-events.h:67
@ DISCORD_EV_VOICE_SERVER_UPDATE
Definition: discord-events.h:127
@ DISCORD_EV_MESSAGE_REACTION_REMOVE_ALL
Definition: discord-events.h:118
@ DISCORD_EV_AUTO_MODERATION_RULE_UPDATE
Definition: discord-events.h:73
@ DISCORD_EVENT_MAIN_THREAD
Definition: discord-events.h:140
@ DISCORD_EVENT_WORKER_THREAD
Definition: discord-events.h:145
@ DISCORD_EVENT_IGNORE
Definition: discord-events.h:138
Definition: application_commands.h:202
Definition: gateway.h:348
Definition: auto_moderation.h:111
Definition: gateway.h:407
Definition: channel.h:122
Definition: gateway.h:416
Definition: gateway.h:423
Definition: gateway.h:430
Definition: gateway.h:444
Definition: gateway.h:449
Definition: gateway.h:456
Definition: gateway.h:485
Definition: gateway.h:505
Definition: gateway.h:519
Definition: gateway.h:512
Definition: gateway.h:526
Definition: gateway.h:535
Definition: guild_scheduled_event.h:38
Definition: gateway.h:437
Definition: gateway.h:544
Definition: interactions.h:48
Definition: gateway.h:553
Definition: gateway.h:582
Definition: gateway.h:600
Definition: gateway.h:591
Definition: gateway.h:609
Definition: gateway.h:637
Definition: gateway.h:646
Definition: gateway.h:624
Definition: channel.h:195
Definition: gateway.h:214
Definition: gateway.h:332
Definition: gateway.h:299
Definition: stage_instance.h:29
Definition: gateway.h:374
Definition: channel.h:336
Definition: gateway.h:394
Definition: gateway.h:657
Definition: gateway.h:320
Definition: gateway.h:670
Definition: gateway.h:679
The Discord client handler.
Definition: discord-internal.h:1190
struct discord_message_commands commands
Definition: discord-internal.h:1201
void * data
Definition: discord-internal.h:1236