Skip to content

Commit

Permalink
fix user id extraction when bot token is prefoxed with Bot
Browse files Browse the repository at this point in the history
  • Loading branch information
topi314 committed Feb 15, 2022
1 parent 4f36f30 commit d3ad219
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lavalink/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
var ErrInvalidBotToken = errors.New("invalid bot token")

func UserIDFromBotToken(token string) (snowflake.Snowflake, error) {
token = strings.TrimPrefix(token, "Bot ")
strs := strings.Split(token, ".")
if len(strs) == 0 {
return "", ErrInvalidBotToken
Expand Down

0 comments on commit d3ad219

Please sign in to comment.