24 Replies
S C:\Users\pokey\OneDrive\Pulpit\Uno Bot C#> dotnet run
Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object. at DiscordBotsList.Api.DiscordBotListApi.GetBotAsync[T](UInt64 id) at DiscordBotsList.Api.AuthDiscordBotListApi.GetMeAsync() at UNO.Program.MainAsync() in C:\Users\pokey\OneDrive\Pulpit\Uno Bot C#\Program.cs:line 40 at UNO.Program.Main(String[] args) in C:\Users\pokey\OneDrive\Pulpit\Uno Bot C#\Program.cs:line 14 this is the error I encounter when Running the code can someone help me? This is the entire code however I'm not sure what's causing it:
Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object. at DiscordBotsList.Api.DiscordBotListApi.GetBotAsync[T](UInt64 id) at DiscordBotsList.Api.AuthDiscordBotListApi.GetMeAsync() at UNO.Program.MainAsync() in C:\Users\pokey\OneDrive\Pulpit\Uno Bot C#\Program.cs:line 40 at UNO.Program.Main(String[] args) in C:\Users\pokey\OneDrive\Pulpit\Uno Bot C#\Program.cs:line 14 this is the error I encounter when Running the code can someone help me? This is the entire code however I'm not sure what's causing it:
Well, something was null
On like 40 most likely
this is line 40
however im confused
discordBotList
is null, then this is the code for discordBotList, would I put the bot token here or? cause im confused if u check the code I sent above
Idk
What do the docs of this particular library say?
Im not sure I wasnt able to find anywhere the issue
and its a discord bot so yea
Well,
System.Environment.GetEnvironmentVariable("UnoDblToken")
does attempt to get the token from env variableshmm
Just not sure tbh
where it could be coming from
From... environmental variables
so where do I find the variables?
You can pass them in the launch config
Or you can set them globally in your system
Or you can set them temporarily for the current terminal session
this is all that my config has, so idk whats easier
?
What does this have to do with the token
Obviously to start a bot you need to use the discord bot token no?
Or with environmental variables
Yeah?
And this code takes said token from an environmental variable
ok
How can Input the token manually or setup the env variable
If you're asking whether you can place this token somewhere else, then sure
Oracle Help Center
Installation and Administration Guide
If the PATH, ORACLE_SID, and ORACLE_HOME environment variables do not exist, you must create them.
Stack Overflow
How do I set specific environment variables when debugging in Visua...
On a class library project, I set the "Start Action" on the Debug tab of the project properties to "Start external program" (NUnit in this case). I want to set an environment variable in the enviro...
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.