summaryrefslogtreecommitdiff
path: root/gateway/src/utils.rs
diff options
context:
space:
mode:
Diffstat (limited to 'gateway/src/utils.rs')
-rw-r--r--gateway/src/utils.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/gateway/src/utils.rs b/gateway/src/utils.rs
new file mode 100644
index 0000000..48a9aed
--- /dev/null
+++ b/gateway/src/utils.rs
@@ -0,0 +1,8 @@
+/// Formats a url of connection to the gateway
+pub fn get_gateway_url (compress: bool, encoding: &str, v: i16) -> String {
+ return format!(
+ "wss://gateway.discord.gg/?v={}&encoding={}&compress={}",
+ v, encoding,
+ if compress { "zlib-stream" } else { "" }
+ );
+} \ No newline at end of file