discord_get_data - get a pointer to user arbitrary data#

void *discord_get_data(struct discord *client)#

Receive user arbitrary data stored with discord_set_data()

Warning

the user should provide his own locking mechanism to protect his data from race conditions

Parameters:
Returns:

pointer to user data

Example#

void on_ready(struct discord *client)
{
  char *text = discord_get_data(client);
  log_trace("%s", text);
}

int main(void)
{
  struct discord *client = discord_init(BOT_TOKEN);
  discord_set_on_ready(client, &on_ready);

  char text[] = "Hello world!";
  discord_set_data(client, text);

  discord_run(client);

  discord_cleanup(client);
}