diff options
| author | Matthieu <matthieu@developershouse.xyz> | 2021-09-19 18:12:41 +0400 |
|---|---|---|
| committer | Matthieu <matthieu@developershouse.xyz> | 2021-09-19 18:12:41 +0400 |
| commit | 6d3caebc79f340d26262adc2ba789b10da4108aa (patch) | |
| tree | 208e1bfe0cf036c0561555e0fc35beabfd261375 /gateway/src/utils.rs | |
| parent | 88300c45202a228d54c1e99dd3b295ef3fb9aabd (diff) | |
shard + implementation of the payload deserialization & restructure
Diffstat (limited to 'gateway/src/utils.rs')
| -rw-r--r-- | gateway/src/utils.rs | 8 |
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 |
