2018-06-28 17:44:29 +02:00
|
|
|
part of nyxx;
|
2016-10-08 23:22:52 +02:00
|
|
|
|
2020-05-17 21:59:52 +02:00
|
|
|
/// Gateway constants
|
2020-05-16 23:56:45 +02:00
|
|
|
class OPCodes {
|
2019-01-08 10:43:46 +01:00
|
|
|
static const int dispatch = 0;
|
|
|
|
static const int heartbeat = 1;
|
|
|
|
static const int identify = 2;
|
|
|
|
static const int statusUpdate = 3;
|
|
|
|
static const int voiceStateUpdate = 4;
|
|
|
|
static const int voiceGuildPing = 5;
|
|
|
|
static const int resume = 6;
|
|
|
|
static const int reconnect = 7;
|
|
|
|
static const int requestGuildMember = 8;
|
|
|
|
static const int invalidSession = 9;
|
|
|
|
static const int hello = 10;
|
|
|
|
static const int heartbeatAck = 11;
|
|
|
|
static const int guildSync = 12;
|
2016-10-10 22:26:59 +02:00
|
|
|
}
|
|
|
|
|
2016-10-08 18:13:56 +02:00
|
|
|
/// The client constants.
|
2020-05-16 23:56:45 +02:00
|
|
|
class Constants {
|
2020-05-17 21:59:52 +02:00
|
|
|
/// Discord CDN host
|
2020-05-04 22:27:51 +02:00
|
|
|
static const String cdnHost = "discordapp.com";
|
2020-05-17 21:59:52 +02:00
|
|
|
|
|
|
|
/// Discord API host
|
2020-05-04 22:27:51 +02:00
|
|
|
static const String host = "discord.com";
|
2020-05-17 21:59:52 +02:00
|
|
|
|
|
|
|
/// Base API uri
|
2020-10-27 00:44:51 +01:00
|
|
|
static const String baseUri = "/api/v8";
|
2020-05-17 21:59:52 +02:00
|
|
|
|
|
|
|
/// Version of Nyxx
|
2021-04-07 22:54:14 +02:00
|
|
|
static const String version = "2.0.0-rc.2";
|
2020-05-17 21:59:52 +02:00
|
|
|
|
|
|
|
/// Url to Nyxx repo
|
2018-08-12 15:18:57 +02:00
|
|
|
static const String repoUrl = "https://github.com/l7ssha/nyxx";
|
2020-06-04 11:01:49 +02:00
|
|
|
|
|
|
|
/// Returns [Uri] to gateway
|
2020-10-26 22:23:21 +01:00
|
|
|
static Uri gatewayUri(String gatewayHost, bool useCompression) {
|
2020-10-27 00:44:51 +01:00
|
|
|
var uriString = "$gatewayHost?v=8&encoding=json";
|
2020-10-26 22:23:21 +01:00
|
|
|
|
|
|
|
if (useCompression) {
|
|
|
|
uriString += "&compress=zlib-stream";
|
|
|
|
}
|
|
|
|
|
|
|
|
return Uri.parse(uriString);
|
|
|
|
}
|
2016-10-08 19:49:00 +02:00
|
|
|
}
|