discord_remove_intents - remove events to listen to#

void discord_remove_intents(struct discord *client, enum discord_gateway_intents code)#

Unsubscribe from Discord Events.

Parameters:
  • client – the client created with discord_init()

  • code – the intents opcode, can be set as bitmask operation Ex: 1 << 0 | 1 << 1 | 1 << 4

Example#

struct discord *client = discord_init(BOT_TOKEN);
// this will implicitly set intents for channel and direct messages
discord_set_on_message_create(client, &on_msg);
// keep only the channel messages intent
discord_remove_intents(client, DISCORD_GATEWAY_DIRECT_MESSAGES);
discord_run(client);
discord_cleanup(client);