#Token

1 messages · Page 1 of 1 (latest)

stark sedge
#

I am new to C# and discord bot development, and so this might be a very stupid problem, but i was searching everywhere and i found nothing.
I have some very basic code for my bot, and i am getting no errors except for error 401 unauthorized. I made sure my token is not a client secret, i even resetted the token and copied the new one to be sure, but i am always getting the same error.

ember owl
#

could you show your code?

stark sedge
#

of course

ember owl
#

so what exactly throws the exception?

stark sedge
#

where ?

ember owl
#

I mean
the Unauthorized thing

#

something is throwing this exception
is it LoginAsync() or StartAsync()?

stark sedge
#

wait, imma take a look :D

ember owl
#

ah, ig you got it from client logs

#

welp
the only thing that could cause this is invalid token

stark sedge
#

well

#

i am just clicking copy token button

#

i don't know what to do

ember owl
#

try commenting out the await RegisterCommandsAsync();

stark sedge
#

ok

#

still error

ember owl
#

did you commit the token to a public github repo by any chance?
discord invalidates commited tokens

stark sedge
#

i don't even know what that means

#

but i downloaded the code from github

ember owl
#

nah, that's not it then

stark sedge
#

it's the latest

ember owl
#

3.10.0?

stark sedge
#

but it's the unstable through myget feed

stark sedge
ember owl
#

Hmmmmm

#

try resetting your token one more time
just for the sanity

stark sedge
#

ok, will do

#

also

#

the console is also throwing this at me, i think it could be useful

#

17:15:17 Discord Discord.Net v2.1.1 (API v6)
17:15:17 Discord A supplied token was invalid.:
System.ArgumentException: A Bot token must be at least 58 characters in length. Ensure that the Bot Token provided is not an OAuth client secret.
Parameter name: token
at Discord.TokenUtils.ValidateToken(TokenType tokenType, String token)
at Discord.Rest.BaseDiscordClient.<LoginInternalAsync>d__34.MoveNext()

ember owl
#

oh well

#

first of all

#

that's not 3.10.0 x_scuseme

#

I think I might know why tho

#

Discord.Net package on myget has bugged dependencies

stark sedge
#

so the nightly build is old ?

ember owl
#

nah

#

just deps are bugged

#

& it defaults to whatever it can find

#

install Discord.Net.X packages one by one

stark sedge
#

ooook

#

will try

ember owl
#

X being Core, Rest, WebSocket, Commands and Interactions