Create DM#

ORCAcode discord_create_dm(struct discord *client, struct discord_create_dm_params *params, struct discord_channel *ret)#

Create a new DM channel with a given user.

Warning

DMs should generally be initiated by a user action. If you open a significant amount of DMs too quickly, your bot may be rate limited or blocked from opening new ones

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

  • params – the request parameters

  • 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

struct discord_create_dm_params#

Methods

  • Initializer:

    • void discord_create_dm_params_init(struct discord_create_dm_params *)

  • Cleanup:

    • void discord_create_dm_params_cleanup(struct discord_create_dm_params *)

    • void discord_create_dm_params_list_free(struct discord_create_dm_params **)

  • JSON Decoder:

    • void discord_create_dm_params_from_json(char *rbuf, size_t len, struct discord_create_dm_params *)

    • void discord_create_dm_params_list_from_json(char *rbuf, size_t len, struct discord_create_dm_params ***)

  • JSON Encoder:

    • void discord_create_dm_params_to_json(char *wbuf, size_t len, struct discord_create_dm_params *)

    • void discord_create_dm_params_list_to_json(char *wbuf, size_t len, struct discord_create_dm_params **)

Public Members

u64_snowflake_t recipient_id#

the recipient to open a DM channel with