Skip to content
Carson Hoffman edited this page Jun 17, 2020 · 3 revisions

HTTP 401 Errors

HTTP 401 Unauthorized, {"code": 0, "message": "401: Unauthorized"}

You may be getting a 401 error if you forgot to prefix your token with Bot (note the trailing space). Discord requires that you do so to authenticate with a bot user.

example:

discordgo.New(`Bot 123456789012345627`)

Build Trouble

Cannot find package

If your go environment is brand new, you may encounter a 'cannot find package' error when building projects that import discordgo. If go can't find it, tell go to go get it.

For example, if you see this in your build output:

...cannot find package "golang.org/x/crypto/nacl/secretbox"...  

Run this to fix it:

go get golang.org/x/crypto/nacl/secretbox  
Clone this wiki locally