diff options
| author | Zeyla Hellyer <[email protected]> | 2017-12-17 07:36:40 -0800 |
|---|---|---|
| committer | Zeyla Hellyer <[email protected]> | 2017-12-17 07:37:32 -0800 |
| commit | 25d79ac7e07654dbf77166d46db33d186faf9885 (patch) | |
| tree | ffce4202aa8af494318b26ce735b28fce2489d56 /src | |
| parent | Fix doc-tests and `single_zc` (diff) | |
| download | serenity-25d79ac7e07654dbf77166d46db33d186faf9885.tar.xz serenity-25d79ac7e07654dbf77166d46db33d186faf9885.zip | |
Trim given token in Client::new
Trims the token given as an argument in Client::new, which will strip
away whitespace that might occur due to including the token from a file.
Diffstat (limited to 'src')
| -rw-r--r-- | src/client/mod.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/client/mod.rs b/src/client/mod.rs index 57fa90e..58d411e 100644 --- a/src/client/mod.rs +++ b/src/client/mod.rs @@ -319,6 +319,8 @@ impl Client { /// ``` pub fn new<H>(token: &str, handler: H) -> Result<Self> where H: EventHandler + Send + Sync + 'static { + let token = token.trim(); + let token = if token.starts_with("Bot ") { token.to_string() } else { |