dscrd
Discord C library
dscrd.h
Go to the documentation of this file.
1 /*
2  * dscrd: Discord C library
3  * Copyright (C) 2018 Jakub Wasylków
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU Lesser General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 // This file was autogenerated by gen_dscrd_h.sh.
20 
21 // common.h
22 
23 #ifndef uint8_t
24 #include <stdint.h>
25 #endif
26 #ifndef bool
27 #include <stdbool.h>
28 #endif
29 
34 #define DISCORD_API 6
35 
36 // needed for types which come before client.h
37 struct DiscordClient_s;
38 
39 // http methods already defined by rest library
40 #ifndef REST_CLIENT_H_
41 
48 };
49 #endif
50 
56 typedef enum dscrd_type_e {
71  // ignoring list types
80 } dscrd_type;
81 
89 int dscrd_has_gateway (void);
90 
96 const char * dscrd_error (void);
97 
104 const char * dscrd_error_long (void);
105 
112 void dscrd_overwrite_api (int api);
113 
121 int dscrd_initialize (void);
122 
131 int dscrd_terminate (void);
132 
133 //
134 // Things which hard to assign somewhere else...
135 //
136 
148 };
149 
153 typedef enum permissions_e {
155  CREATE_INSTANT_INVITE = 0x00000001,
157  KICK_MEMBERS = 0x00000002,
159  BAN_MEMBERS = 0x00000004,
161  ADMINISTRATOR = 0x00000008,
163  MANAGE_CHANNELS = 0x00000010,
165  MANAGE_GUILD = 0x00000020,
167  ADD_REACTIONS = 0x00000040,
169  VIEW_AUDIT_LOG = 0x00000080,
171  VIEW_CHANNEL = 0x00000400,
173  SEND_MESSAGES = 0x00000800,
175  SEND_TTS_MESSAGES = 0x00001000,
177  MANAGE_MESSAGES = 0x00002000,
179  EMBED_LINKS = 0x00004000,
181  ATTACH_FILES = 0x00008000,
183  READ_MESSAGE_HISTORY = 0x00010000,
185  MENTION_EVERYONE = 0x00020000,
187  USE_EXTERNAL_EMOJIS = 0x00040000,
189  CONNECT = 0x00100000,
191  SPEAK = 0x00200000,
193  MUTE_MEMBERS = 0x00400000,
195  DEAFEN_MEMBERS = 0x00800000,
197  MOVE_MEMBERS = 0x01000000,
199  USE_VAD = 0x02000000,
201  PRIORITY_SPEAKER = 0x00000100,
203  CHANGE_NICKNAME = 0x04000000,
205  MANAGE_NICKNAMES = 0x08000000,
207  MANAGE_ROLES = 0x10000000,
209  MANAGE_WEBHOOKS = 0x20000000,
211  MANAGE_EMOJI = 0x40000000
212 } permissions;
213 
214 #define ID(X) X ## "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
215 
216 // activity.h
217 
231 };
232 
239 typedef struct DiscordActivity_s {
241  char application_id[21];
243  uint8_t _type;
246  char *name;
248  int type;
250  char *url;
254 
256 
258  char *details;
260  char *state;
261 
262  // information for the current party of the player
263  // party object
264 
265  // images for the presence and their hover texts
266  // assets object
267 
268  // secrets for Rich Presence joining and spectating
269  // secrets object
270 
272  bool instance;
274  int flags;
276 // user.h
277 
290 };
291 
297 typedef struct DiscordUser_s {
299  char id[21];
301  uint8_t _type;
303  char * username;
305  char discriminator[5];
307  char *avatar;
309  bool bot;
313  bool verified;
315  char *email;
316 
318 } DiscordUser;
319 
329 DiscordUser * DiscordUser_me (struct DiscordClient_s *client);
330 
339 DiscordUser * DiscordUser_get (struct DiscordClient_s *client, char * user_id);
345 
346 // client.h
347 
352 typedef enum token_type_e {
354 } token_type;
355 
356 #define TOKEN_TO_STR(X) (X == Bearer) ? "Bearer" : (X == Bot) ? "Bot" : (X == User) ? "User" : ""
357 
366 typedef struct DiscordClient_s {
368  char _name[21];
369  //
370  uint8_t _type;
372  void *c;
375  unsigned char api;
379  char * token;
381  char * auth_string;
382 
384  struct DiscordUser_s me;
387 
389  unsigned char user_status;
390 
392  bool temporary;
393  // ref-count, numebers equal entries dscrd_type_e
394  short refc[DSCRD_TYPE_LAST];
396  void *gateway;
399 } DiscordClient;
400 
413 DiscordClient * DiscordClient_open (token_type type, const char * token);
414 
422 #define DiscordClient_open_auth(X) DiscordClient_open((X)->type, (X)->token)
423 
432 
435  // last flags
437 };
438 
450 int DiscordClient_gateway (DiscordClient *client, int flags);
451 
461 int DiscordClient_set_status (DiscordClient *client, enum dscrd_user_status status);
462 
472 int DiscordClient_set_game (DiscordClient *client, DiscordActivity *activity);
473 
474 // dscrdd.h
475 
480 typedef struct DscrdAuth_s {
481  char token[64];
483 } DscrdAuth;
484 
485 
496 int dscrdd_auth (DscrdAuth *auth, const char *app_name);
497 
498 // guild.h
499 
505 typedef struct DiscordGuild_s {
507  char id[21];
508  //
509  uint8_t _type;
511  char * name;
513  char * icon;
515  char * splash;
517  bool owner;
519  char owner_id[21];
523  char * region;
525  char afk_channel_id[21];
531  char embed_channel_id[21];
539  /*TODO*/ //
541  /*TODO*/ //
543  char **features;
547  char application_id[21];
551  char widget_channel_id[21];
553  char system_channel_id[21];
554  // These fields are only sent within the GUILD_CREATE event:
555  /*
556  joined_at? * ISO8601 timestamp when this guild was joined at
557  large? * bool whether this is considered a large guild
558  unavailable? * bool is this guild unavailable
559  member_count? * integer total number of members in this guild
560  voice_states? * array of partial voice state objects (without the guild_id key)
561  members? * array of guild member objects users in the guild
562  channels? * array of channel objects channels in the guild
563  presences? *
564  */
566 } DiscordGuild;
567 
577 DiscordGuild * DiscordGuild_get (DiscordClient *client, char *guild_id);
578 
587 DiscordGuild * DiscordGuild_by_name (DiscordClient *client, char *guild_name);
588 
598 
603 void DiscordGuilds_destroy (DiscordGuild **guilds);
604 
609 void DiscordGuild_destroy (DiscordGuild *guild);
610 
611 // channel.h
612 
619 typedef struct DiscordChannel_s {
621  char id[21];
623  uint8_t _type;
625  int type;
627  char guild_id[21];
629  int position;
630  // todo permission overwrites
631  char *name;
632  char *topic;
633 
634  bool nsfw;
635  char last_message_id[21];
636 
637  int bitrate;
639  // recipients?
640  char *icon;
641  char owner_id[21];
642  char application_id[21];
643  char parent_id[21];
645 
648 
649 typedef struct DiscordChannelList_s {
650  int count;
653 
661 };
662 
663 
675 DiscordChannel * DiscordChannel_get (DiscordClient *client, char *channel_id);
676 
688 DiscordChannel * DiscordChannel_get_fast (DiscordClient *client, char *channel_id);
689 
701 int DiscordChannel_modify (DiscordChannel *channel, ...);
702 
712 DiscordChannel * DiscordChannel_by_name (DiscordGuild *guild, char *channel_name);
713 
722 int DiscordChannel_send_message_simple (DiscordChannel *channel, const char *message);
723 
732 
741 
747 
752 void DiscordChannel_destroy (DiscordChannel * channel);
753 
754 // file.h
755 
757 #define DSCRD_FILE_NULL ((DscrdFile *) "dummy")
758 
765 typedef struct DscrdFile_s {
766  char head[13];
767  uint32_t data_len;
768  uint32_t data_base64_len;
769  uint8_t _type;
770  char *mime;
771  char *filename;
772  char *data;
773  char *data_base64;
774  char *encoded;
775 } DscrdFile;
776 
785 DscrdFile * DscrdFile_get (const char *filename);
786 
796 DscrdFile * DscrdFile_get_mime (const char *filename, const char *mime_type);
797 
802 void DscrdFile_destroy (DscrdFile *file);
803 
804 // message.h
805 
806 typedef struct DiscordMessage_s {
808  char id[21];
810  uint8_t _type;
812  char channel_id[21];
816  char *content;
818  char *timestamp;
822  bool tts;
828  // TODO roles type //mention_roles
830  // todo //attachments
832  // embeds
834  // reactions
836  char nonce[21];
838  bool pinned;
840  char webhook_id[21];
842  int type;
843 
844  // sent with Rich Presence-related chat embeds:
845  // activity
846  // application
847 
849 
851 
855 };
856 
858 int DiscordMessage_callback_all (DiscordClient *client, int (*callback)(DiscordMessage *));
859 
860 int DiscordMessage_callback_mentions (DiscordClient *client, int (*callback)(DiscordMessage *));
861 
863 int DiscordMessage_delete_id (DiscordClient *client, const char *channel_id, const char *message_id);
864 
867 
869 DiscordMessage * DiscordMessage_new_simple (DiscordChannel *channel, const char *message);
870 
872 
873 DiscordMessage * DiscordMessage_get (DiscordChannel *channel, char *message_id);
874 
875 // webhook.h
876 
882 typedef struct Webhook_s {
883  // id is in snowflake format, 64-bit -> uint64 -> strlen(uint64_max) == 20 bytes + terminating char
885  char id[21];
886  //
887  uint8_t _type;
889  char guild_id[21];
891  char channel_id[21];
897  char * name;
899  char * avatar;
901  char token[128];
903  bool use_token;
906 } Webhook;
907 
913 typedef struct WebhookList_s {
914  int count;
916 } WebhookList;
917 
929 Webhook * Webhook_get (DiscordClient *client, char * id);
930 
943 Webhook * Webhook_get_no_auth (char * id, char * token);
944 
953 Webhook * Webhook_get_no_auth_url (const char * url);
954 
964 Webhook * Webhook_create (DiscordChannel * channel, char * name, DscrdFile * avatar);
965 
970 void Webhook_destroy (Webhook * webhook);
971 
982 int Webhook_execute (Webhook * webhook, const char * message, const char * username, const char * avatar_url);
983 
992 int Webhook_execute_simple (Webhook * webhook, const char * message);
993 
1004 int Webhook_delete (Webhook * webhook);
1005 
1016 int Webhook_modify (Webhook *webhook, const char *name, DscrdFile *avatar);
1017 
1026 int Webhook_move (Webhook *webhook, DiscordChannel *channel);
1027 
1037 
1047 
1052 void WebhookList_destroy (WebhookList *list);
1053 
1054 // con/gateway.h
1055 
1056 struct DiscordGuild_s;
1057 
1058 
1067 
1068 
1069 typedef struct GatewayResp_s {
1071  char *event;
1073  void *data;
1077  unsigned char terminate;
1079  void *userdata;
1080 } GatewayResp;
1081 
1085 };
1086 
1087 
1088 int DiscordGateway_callback (DiscordClient *client, char *event, int (*func)(GatewayResp *), void *userdata);
1089 
Allows for deafening of members in a voice channel.
Definition: dscrd.h:195
Streaming ...
Definition: dscrd.h:228
Allows for viewing of audit logs.
Definition: dscrd.h:169
indicates last value of types
Definition: dscrd.h:77
DiscordGuild * DiscordGuild_get(DiscordClient *client, char *guild_id)
DiscordGuild ** DiscordGuilds_get(DiscordClient *client)
0 element, will be set if uninitialized, therefore ignored
Definition: dscrd.h:58
Definition: dscrd.h:854
void WebhookList_destroy(WebhookList *list)
bool tts
whether this was a TTS message
Definition: dscrd.h:822
Definition: dscrd.h:353
DscrdFile
Definition: dscrd.h:73
Allows for muting members in a voice channel.
Definition: dscrd.h:193
Webhook
Definition: dscrd.h:66
Activity object (game)
Definition: dscrd.h:239
Allows all permissions and bypasses channel permission overwrites.
Definition: dscrd.h:161
Discord file wrapper.
Definition: dscrd.h:765
struct DiscordClient_s * discord_client
Definition: dscrd.h:565
char * name
guild name
Definition: dscrd.h:511
bool nsfw
Definition: dscrd.h:634
uint8_t _type
Definition: dscrd.h:509
Allows guild members to view a channel, which includes reading messages in text channels.
Definition: dscrd.h:171
int timestamp_stop
Definition: dscrd.h:255
Listening to ...
Definition: dscrd.h:230
char * encoded
Definition: dscrd.h:774
Allows for using voice-activity-detection in a voice channel.
Definition: dscrd.h:199
Online.
Definition: dscrd.h:281
DiscordChannel * DiscordChannelList_pop(DiscordChannelList *list, int i)
Definition: dscrd.h:854
Allows management and editing of the guild.
Definition: dscrd.h:165
DiscordClient
Definition: dscrd.h:68
DiscordChannelList * DiscordChannels_in_guild(DiscordGuild *guild)
char * edited_timestamp
when this message was edited (or null if never)
Definition: dscrd.h:820
unsigned char user_status
current user status, one of dscrd_user_status
Definition: dscrd.h:389
Allows for joining of a voice channel.
Definition: dscrd.h:189
AFK.
Definition: dscrd.h:285
void DiscordClient_close(DiscordClient *d)
int DiscordChannel_send_message_simple(DiscordChannel *channel, const char *message)
int bitrate
Definition: dscrd.h:637
char * content
contents of the message
Definition: dscrd.h:816
int Webhook_execute(Webhook *webhook, const char *message, const char *username, const char *avatar_url)
Definition: dscrd.h:853
Webhook * Webhook_get_no_auth_url(const char *url)
Definition: dscrd.h:47
Allows kicking members.
Definition: dscrd.h:157
Definition: dscrd.h:353
bool pinned
whether this message is pinned
Definition: dscrd.h:838
Allows the usage of custom emojis from other servers.
Definition: dscrd.h:187
activity_types
Activity types.
Definition: dscrd.h:224
permissions_e
Permissions also described at https://discordapp.com/developers/docs/topics/permissions.
Definition: dscrd.h:153
Discord channel.
Definition: dscrd.h:619
char * icon
icon hash
Definition: dscrd.h:513
Webhook ** w
Definition: dscrd.h:915
int dscrd_initialize(void)
int DiscordClient_set_status(DiscordClient *client, enum dscrd_user_status status)
uint8_t _type
Definition: dscrd.h:370
void DiscordChannel_destroy(DiscordChannel *channel)
Definition: dscrd.h:853
Discord user.
Definition: dscrd.h:297
char * filename
Definition: dscrd.h:771
Allows management and editing of roles.
Definition: dscrd.h:207
uint32_t data_len
Definition: dscrd.h:767
Definition: dscrd.h:434
char * icon
Definition: dscrd.h:640
Definition: dscrd.h:806
struct DiscordUser_s * user
DiscordUser_s pointer of current user; equal to DiscordClient::me except it&#39;s a pointer.
Definition: dscrd.h:386
int position
"sorting position of the channel"
Definition: dscrd.h:629
char * avatar
the default avatar of the webhook (optional)
Definition: dscrd.h:899
must have a verified phone number
Definition: dscrd.h:147
int DiscordMessage_delete(DiscordMessage *message)
Delete specified message.
DiscordClient * discord_client
Definition: dscrd.h:848
Playing ...
Definition: dscrd.h:226
Discord guild.
Definition: dscrd.h:505
Allows for sending messages in a channel.
Definition: dscrd.h:173
int count
Definition: dscrd.h:914
void DiscordChannelList_destroy(DiscordChannelList *channels)
enum dscrd_type_e dscrd_type
Discord datatypes.
int DiscordClient_set_game(DiscordClient *client, DiscordActivity *activity)
char * token
pure token
Definition: dscrd.h:379
int DiscordClient_gateway(DiscordClient *client, int flags)
bool verified
whether the email on this account has been verified email
Definition: dscrd.h:313
int Webhook_move(Webhook *webhook, DiscordChannel *channel)
Offline.
Definition: dscrd.h:289
bool temporary
tells if created DiscordClient is temporary and has to be freed when connected object is freed...
Definition: dscrd.h:392
struct WebhookList_s WebhookList
WebhookList structure.
int count
Definition: dscrd.h:650
void DiscordMessage_destroy(DiscordMessage *msg)
Allows for using the @everyone tag to notify all users in a channel, and the @here tag to notify all ...
Definition: dscrd.h:185
DiscordChannel * DiscordChannel_get_fast(DiscordClient *client, char *channel_id)
struct DiscordChannel_s DiscordChannel
Discord channel.
struct DiscordGuild_s ** DiscordClient_lazy_guilds(DiscordClient *client)
char * name
the default name of the webhook (optional)
Definition: dscrd.h:897
int data_type
type of d pointer, one of dscrd_type_e
Definition: dscrd.h:1075
char * name
Definition: dscrd.h:631
int default_message_notifications
default message notifications level
Definition: dscrd.h:535
int DiscordMessage_callback_mentions(DiscordClient *client, int(*callback)(DiscordMessage *))
uint8_t _type
reserved
Definition: dscrd.h:810
Definition: dscrd.h:853
void * data
data pointer
Definition: dscrd.h:1073
gateway_flags
Definition: dscrd.h:433
uint8_t _type
reserved
Definition: dscrd.h:243
Allows for uploading images and files.
Definition: dscrd.h:181
int explicit_content_filter
explicit content filter level
Definition: dscrd.h:537
Allows for using priority speaker in a voice channel.
Definition: dscrd.h:201
WebhookList structure.
Definition: dscrd.h:913
DiscordMessage
Definition: dscrd.h:75
int DiscordChannel_modify(DiscordChannel *channel,...)
struct DiscordUser_s DiscordUser
Discord user.
Allows for modification of own nickname.
Definition: dscrd.h:203
Definition: dscrd.h:660
char * topic
Definition: dscrd.h:632
struct Webhook_s Webhook
Webhook structure.
void DiscordGuild_destroy(DiscordGuild *guild)
Allows for deletion of other users messages.
Definition: dscrd.h:177
int type
channel type, one of channel_types
Definition: dscrd.h:625
uint8_t _type
reserved for type detection
Definition: dscrd.h:623
must be a member of the server for longer than 10 minutes
Definition: dscrd.h:145
char * data_base64
Definition: dscrd.h:773
char * auth_string
Authentication header used by rest library.
Definition: dscrd.h:381
DiscordMessage * DiscordMessage_get(DiscordChannel *channel, char *message_id)
struct DiscordClient_s * discord_client
Definition: dscrd.h:317
Allows for the addition of reactions to messages.
Definition: dscrd.h:167
void dscrd_overwrite_api(int api)
int timestamp_start
Definition: dscrd.h:253
bool embed_enabled
is this guild embeddable (e.g. widget)
Definition: dscrd.h:529
Definition: dscrd.h:47
DiscordUser * DiscordUser_get(struct DiscordClient_s *client, char *user_id)
Definition: dscrd.h:1069
bool mention_everyone
whether this message mentions everyone
Definition: dscrd.h:824
DiscordClient * discord_client
DiscordClient of the Webhook.
Definition: dscrd.h:905
token_type type
Definition: dscrd.h:482
token_type type
Session type, one of token_type_e.
Definition: dscrd.h:377
int dscrd_has_gateway(void)
uint8_t _type
Definition: dscrd.h:769
void DscrdFile_destroy(DscrdFile *file)
Webhook * Webhook_create(DiscordChannel *channel, char *name, DscrdFile *avatar)
Definition: dscrd.h:1083
const char * dscrd_error(void)
struct DiscordClient_s DiscordClient
Discord session.
int Webhook_delete(Webhook *webhook)
Allows for speaking in a voice channel.
Definition: dscrd.h:191
Definition: dscrd.h:47
DiscordClient * discord_client
Definition: dscrd.h:646
Definition: dscrd.h:436
Definition: dscrd.h:47
DiscordUser
Definition: dscrd.h:64
bool mfa_enabled
whether the user has two factor enabled on their account identify
Definition: dscrd.h:311
char * splash
splash hash (?)
Definition: dscrd.h:515
DiscordUser ** mentions
users specifically mentioned in the message
Definition: dscrd.h:826
void DiscordUser_destroy(DiscordUser *user)
char * data
Definition: dscrd.h:772
WebhookList * Webhooks_in_guild(DiscordClient *client, DiscordGuild *guild)
char * timestamp
when this message was sent
Definition: dscrd.h:818
Allows for moving of members between voice channels.
Definition: dscrd.h:197
Allows management and editing of emojis.
Definition: dscrd.h:211
Allows management and editing of webhooks.
Definition: dscrd.h:209
DscrdFile * DscrdFile_get_mime(const char *filename, const char *mime_type)
uint8_t _type
Definition: dscrd.h:301
Definition: dscrd.h:660
Definition: dscrd.h:660
Definition: dscrd.h:353
char * event
response type
Definition: dscrd.h:1071
http_method
HTTP Methods.
Definition: dscrd.h:46
token_type_e
Definition: dscrd.h:352
bool owner
whether or not the user is the owner of the guild
Definition: dscrd.h:517
int Webhook_modify(Webhook *webhook, const char *name, DscrdFile *avatar)
int mfa_level
required MFA level for the guild
Definition: dscrd.h:545
int dscrdd_auth(DscrdAuth *auth, const char *app_name)
Definition: dscrd.h:1084
int verification_level
verification level required for the guild
Definition: dscrd.h:533
Do not disturb.
Definition: dscrd.h:283
int afk_timeout
afk timeout in seconds
Definition: dscrd.h:527
int dscrd_terminate(void)
Definition: dscrd.h:79
WebhookList * Webhooks_in_channel(DiscordClient *client, DiscordChannel *channel)
Definition: dscrd.h:660
DiscordClient * DiscordClient_open(token_type type, const char *token)
unrestricted
Definition: dscrd.h:139
Definition: dscrd.h:47
void Webhook_destroy(Webhook *webhook)
char * name
Definition: dscrd.h:246
DiscordGuild
Definition: dscrd.h:60
DiscordChannel * DiscordChannel_get(DiscordClient *client, char *channel_id)
struct DiscordChannelList_s DiscordChannelList
RestResp
Definition: dscrd.h:70
char application_id[21]
application id for the game
Definition: dscrd.h:241
DscrdFile * DscrdFile_get(const char *filename)
int type
type of message
Definition: dscrd.h:842
char * state
the user&#39;s current party status
Definition: dscrd.h:260
DiscordGuild * DiscordGuild_by_name(DiscordClient *client, char *guild_name)
Allows creation of instant invites.
Definition: dscrd.h:155
int DiscordGateway_callback(DiscordClient *client, char *event, int(*func)(GatewayResp *), void *userdata)
struct DiscordMessage_s DiscordMessage
void * c
Pointer used internally by rest library, it&#39;s casted default to void except in library.
Definition: dscrd.h:372
int Webhook_execute_simple(Webhook *webhook, const char *message)
Links sent by users with this permission will be auto-embedded.
Definition: dscrd.h:179
must be registered on Discord for longer than 5 minutes
Definition: dscrd.h:143
char * region
voice region id for the guild
Definition: dscrd.h:523
Allows for reading of message history.
Definition: dscrd.h:183
DiscordChannel
Definition: dscrd.h:62
char * url
stream url, required if type is ACTIVITY_STREAMING, only twitch.tv supported
Definition: dscrd.h:250
int permissions
total permissions for the user in the guild (does not include channel overrides)
Definition: dscrd.h:521
void DiscordGuilds_destroy(DiscordGuild **guilds)
char * mime
Definition: dscrd.h:770
DiscordChannel ** c
Definition: dscrd.h:651
must have verified email on account
Definition: dscrd.h:141
Webhook structure.
Definition: dscrd.h:882
DiscordUser * author
author
Definition: dscrd.h:814
Definition: dscrd.h:480
bool bot
whether the user belongs to an OAuth2 application identify
Definition: dscrd.h:309
struct DiscordGuild_s DiscordGuild
Discord guild.
int DiscordMessage_delete_id(DiscordClient *client, const char *channel_id, const char *message_id)
Delete message after channel and message id.
DiscordUser * DiscordUser_me(struct DiscordClient_s *client)
char * username
username, not unique across platform identify
Definition: dscrd.h:303
int type
activity type
Definition: dscrd.h:248
int DiscordMessage_callback_all(DiscordClient *client, int(*callback)(DiscordMessage *))
TODO.
Webhook * Webhook_get(DiscordClient *client, char *id)
DiscordMessage * DiscordMessage_new_simple(DiscordChannel *channel, const char *message)
new message (returns back)
void * gateway
pointer to DiscordGateway session (if any)
Definition: dscrd.h:396
DiscordUser user
user object the user this webhook was created by (not returned when getting a webhook with its token)...
Definition: dscrd.h:893
channel_types
Channel types.
Definition: dscrd.h:659
unsigned char api
Definition: dscrd.h:375
struct DiscordActivity_s DiscordActivity
Activity object (game)
bool instance
whether or not the activity is an instanced game session
Definition: dscrd.h:272
uint8_t _type
Definition: dscrd.h:887
enum permissions_e permissions
Permissions also described at https://discordapp.com/developers/docs/topics/permissions.
unsigned char terminate
tell callback we&#39;re finished, free all memory etc.
Definition: dscrd.h:1077
Definition: dscrd.h:47
struct DscrdFile_s DscrdFile
Discord file wrapper.
const char * dscrd_error_long(void)
Allows for modification of other users nicknames.
Definition: dscrd.h:205
DiscordChannel * DiscordChannel_by_name(DiscordGuild *guild, char *channel_name)
uint32_t data_base64_len
Definition: dscrd.h:768
message_types
Definition: dscrd.h:852
Allows management and editing of channels.
Definition: dscrd.h:163
struct GatewayResp_s GatewayResp
Definition: dscrd.h:649
void * userdata
pointer to provided userdata
Definition: dscrd.h:1079
dscrd_type_e
Discord datatypes.
Definition: dscrd.h:56
struct DscrdAuth_s DscrdAuth
Shown as offline.
Definition: dscrd.h:287
Webhook * Webhook_get_no_auth(char *id, char *token)
Definition: dscrd.h:660
int gateway_flags
flags
Definition: dscrd.h:398
char * details
what the player is currently doing
Definition: dscrd.h:258
Definition: dscrd.h:854
char ** features
roles in the guild
Definition: dscrd.h:543
Allows for sending of /tts messages.
Definition: dscrd.h:175
enum token_type_e token_type
Allows banning members.
Definition: dscrd.h:159
int flags
activity flags ORd together, describes what the payload includes
Definition: dscrd.h:274
Definition: dscrd.h:854
DiscordUser * user_p
same as user but pointer
Definition: dscrd.h:895
Definition: dscrd.h:853
int user_limit
Definition: dscrd.h:638
dscrd_verification_level
Definition: dscrd.h:137
Definition: dscrd.h:353
gateway_callback_resp
Definition: dscrd.h:1082
bool use_token
prefer to use token instead of auth
Definition: dscrd.h:903
Discord session.
Definition: dscrd.h:366
dscrd_user_status
User status.
Definition: dscrd.h:279
Definition: dscrd.h:47
char * email
the user&#39;s email
Definition: dscrd.h:315
bool widget_enabled
whether or not the server widget is enabled
Definition: dscrd.h:549
char * avatar
avatar hash
Definition: dscrd.h:307
char * last_pin_timestamp
Definition: dscrd.h:644