discord-rpc/include/discord-rpc.h

62 lines
1.8 KiB
C
Raw Normal View History

2017-06-24 01:04:36 +02:00
#pragma once
2017-06-29 18:38:07 +02:00
#include <stdint.h>
2017-06-24 01:04:36 +02:00
struct DiscordRichPresence {
2017-06-29 17:58:38 +02:00
const char* state;
const char* details;
2017-06-29 18:38:07 +02:00
int64_t startTimestamp;
int64_t endTimestamp;
2017-06-29 17:58:38 +02:00
const char* largeImageKey;
const char* largeImageText;
const char* smallImageKey;
const char* smallImageText;
2017-06-24 01:04:36 +02:00
const char* partyId;
2017-06-29 17:58:38 +02:00
int partySize;
int partyMax;
const char* matchSecret;
const char* joinSecret;
const char* spectateSecret;
bool instance;
2017-06-24 01:04:36 +02:00
};
struct DiscordEventHandlers {
// required.
void (*ready)();
void (*disconnected)();
// optional for rich presence
void (*wantsPresence)();
void (*joinGame)(const char* joinSecret);
void (*spectateGame)(const char* spectateSecret);
};
2017-06-29 17:58:38 +02:00
void Discord_Initialize(const char* applicationId, DiscordEventHandlers* handlers);
void Discord_Shutdown();
void Discord_UpdatePresence(const DiscordRichPresence* presence);
/* later
2017-06-24 01:04:36 +02:00
struct DiscordChannelEventHandlers {
void (*messageCreate)(const DiscordMessage* message);
void (*messageUpdate)(const DiscordMessage* message);
void (*messageDelete)(const DiscordMessage* message);
void (*voiceStateCreate)(const DiscordVoiceState* state);
void (*voiceStateDelete)(const DiscordVoiceState* state);
void (*speakingStart)(const DiscordSpeakingState* state);
void (*speakingStop)(const DiscordSpeakingState* state);
2017-06-29 17:58:38 +02:00
};
2017-06-24 01:04:36 +02:00
// Call this to subscribe to events in a specific voice or text channel
2017-06-29 17:58:38 +02:00
void Discord_Subscribe(const char* channelId, const DiscordChannelEventHandlers* handlers);
2017-06-24 01:04:36 +02:00
// TBD RPC Requests
void Discord_Authenticate();
void Discord_Authorize();
void Discord_GetGuilds();
void Discord_GetChannels();
void Discord_GetChannel();
void Discord_SelectVoiceChannel();
void Discord_SelectTextChannel();
void Discord_SendMessage();
2017-06-29 17:58:38 +02:00
*/