Browse Source

Allow GetPrefixedToken to handle the default TokenType

This prevents an issue where no clients could be constructed.

In 2fd4f56, the case for user tokens was removed from GetPrefixedToken,
which means that the default value for TokenType would now fallthrough
to the default case, which throws an error.
tags/2.0
Christopher F 7 years ago
parent
commit
e68ef63bc6
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      src/Discord.Net.Rest/DiscordRestApiClient.cs

+ 2
- 0
src/Discord.Net.Rest/DiscordRestApiClient.cs View File

@@ -69,6 +69,8 @@ namespace Discord.API
{ {
switch (tokenType) switch (tokenType)
{ {
case default(TokenType):
return token;
case TokenType.Bot: case TokenType.Bot:
return $"Bot {token}"; return $"Bot {token}";
case TokenType.Bearer: case TokenType.Bearer:


Loading…
Cancel
Save