Utils#

void discord_overwrite_append(struct discord_overwrite ***permission_overwrites, u64_snowflake_t id, int type, u64_bitmask_t allow, u64_bitmask_t deny)#

Append to an overwrite list.

Note

the list should be freed with discord_overwrite_list_free() after its no longer being used

Parameters:
  • permission_overwrites – list to be appended to

  • id – role or user id

  • type – either 0 (role) or 1 (member)

  • allow – permission bit set

  • deny – permission bit set

ORCAcode discord_get_channel_at_pos(struct discord *client, u64_snowflake_t guild_id, enum discord_channel_types type, size_t position, struct discord_channel *ret)#

Get a guild’s channel from its given numerical position.

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

  • guild_id – guild the channel belongs to

  • type – the channel type where to take position reference from

  • ret – if successful, a discord_channel that should be free’d with discord_channel_cleanup()

Returns:

ORCAcode for how the operation went, ORCA_OK means nothing out of the ordinary

ORCAcode discord_delete_messages_by_author_id(struct discord *client, u64_snowflake_t channel_id, u64_snowflake_t author_id)#

Delete messages from a channel by a given author.

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

  • channel_id – channel where the messages resides

  • author_id – the user who sent those messages

Returns:

ORCAcode for how the operation went, ORCA_OK means nothing out of the ordinary