nyxx/nyxx/lib/src/internal/_Constants.dart

48 lines
1.2 KiB
Dart
Raw Normal View History

part of nyxx;
2016-10-08 23:22:52 +02:00
/// Gateway constants
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.
class Constants {
/// Discord CDN host
static const String cdnHost = "discordapp.com";
/// Discord API host
static const String host = "discord.com";
/// Base API uri
static const String baseUri = "/api/v8";
/// Version of Nyxx
static const String version = "2.0.0-rc.2";
/// Url to Nyxx repo
2018-08-12 15:18:57 +02:00
static const String repoUrl = "https://github.com/l7ssha/nyxx";
/// Returns [Uri] to gateway
static Uri gatewayUri(String gatewayHost, bool useCompression) {
var uriString = "$gatewayHost?v=8&encoding=json";
if (useCompression) {
uriString += "&compress=zlib-stream";
}
return Uri.parse(uriString);
}
2016-10-08 19:49:00 +02:00
}