This repository has been archived by the owner on May 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
discord_rpc.d
52 lines (47 loc) · 1.69 KB
/
discord_rpc.d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
module discord_rpc;
extern (C) {
struct DiscordRichPresence {
char *state; /* max 128 bytes */
char *details; /* max 128 bytes */
long startTimestamp;
long endTimestamp;
char *largeImageKey; /* max 32 bytes */
char *largeImageText; /* max 128 bytes */
char *smallImageKey; /* max 32 bytes */
char *smallImageText; /* max 128 bytes */
char *partyId; /* max 128 bytes */
int partySize;
int partyMax;
char *matchSecret; /* max 128 bytes */
char *joinSecret; /* max 128 bytes */
char *spectateSecret; /* max 128 bytes */
byte instance;
}
struct DiscordEventHandlers {
void function(const DiscordUser *request) ready;
void function(int errorCode, const char *message) disconnected;
void function(int errorCode, const char *message) errored;
void function(const char *joinSecret) joinGame;
void function(const char *spectateSecret) spectateGame;
void function(const DiscordUser *request) joinRequest;
}
struct DiscordUser {
char *userId;
char *username;
char *discriminator;
char *avatar;
}
enum {
DISCORD_REPLY_NO = 0,
DISCORD_REPLY_YES = 1,
DISCORD_REPLY_IGNORE = 2
}
void Discord_Initialize(const char *applicationId, DiscordEventHandlers *handlers, int autoRegister, const char *optionalSteamId) nothrow @nogc @system;
void Discord_Shutdown() nothrow @nogc @system;
void Discord_RunCallbacks() nothrow @nogc @system;
void Discord_UpdateConnection() nothrow @nogc @system;
void Discord_UpdatePresence(const DiscordRichPresence *presence) nothrow @nogc @system;
void Discord_ClearPresence() nothrow @nogc @system;
void Discord_Respond(const char *userid, int reply) nothrow @nogc @system;
void Discord_UpdateHandlers(DiscordEventHandlers *handlers) nothrow @nogc @system;
}