Create Guild Application Command#

ORCAcode discord_create_guild_application_command(struct discord *client, u64_snowflake_t application_id, u64_snowflake_t guild_id, struct discord_create_guild_application_command_params *params, struct discord_application_command *ret)#

Create a new guild command.

Note

Commands will be available in the guild immediately

Note

Will overwrite any existing guild command with the same name

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

  • application_id – the unique id of the parent application

  • guild_id – the guild where the command is located

  • params – request parameters

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

Returns:

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

struct discord_create_guild_application_command_params#

Methods

  • Initializer:

    • void discord_create_guild_application_command_params_init(struct discord_create_guild_application_command_params *)

  • Cleanup:

    • void discord_create_guild_application_command_params_cleanup(struct discord_create_guild_application_command_params *)

    • void discord_create_guild_application_command_params_list_free(struct discord_create_guild_application_command_params **)

  • JSON Decoder:

    • void discord_create_guild_application_command_params_from_json(char *rbuf, size_t len, struct discord_create_guild_application_command_params *)

    • void discord_create_guild_application_command_params_list_from_json(char *rbuf, size_t len, struct discord_create_guild_application_command_params ***)

  • JSON Encoder:

    • void discord_create_guild_application_command_params_to_json(char *wbuf, size_t len, struct discord_create_guild_application_command_params *)

    • void discord_create_guild_application_command_params_list_to_json(char *wbuf, size_t len, struct discord_create_guild_application_command_params **)

Public Members

char *name#

1-32 lowercase character name

char *description#

1-100 character description

struct discord_application_command_option **options#

the parameters for the command

bool default_permission#

whether the command is enabled by default when the app is added to a guild

enum discord_application_command_types type#