I am trying to get my bot to run and it isn't running.
I keep getting this:
12:28:11 Discord Discord.Net v3.9.0 (API v10)
12:28:11 Discord A supplied token was invalid.:
System.ArgumentNullException: A token cannot be null, empty, or contain only whitespace. (Parameter 'token')
at Discord.TokenUtils.ValidateToken(TokenType tokenType, String token)
at Discord.Rest.BaseDiscordClient.LoginInternalAsync(TokenType tokenType, String token, Boolean validateToken)
12:28:11 Gateway Connecting
12:28:13 Gateway Discord.Net.HttpException: The server responded with error 401: 401: Unauthorized
at Discord.Net.Queue.RequestBucket.SendAsync(RestRequest request)
at Discord.Net.Queue.RequestQueue.SendAsync(RestRequest request)
at Discord.API.DiscordRestApiClient.SendInternalAsync(String method, String endpoint, RestRequest request)
at Discord.API.DiscordRestApiClient.SendAsync[TResponse](String method, String endpoint, BucketId bucketId, ClientBucketType clientBucket, RequestOptions options)
at Discord.API.DiscordRestApiClient.GetBotGatewayAsync(RequestOptions options)
at Discord.API.DiscordSocketApiClient.ConnectInternalAsync()
at Discord.API.DiscordSocketApiClient.ConnectInternalAsync()
at Discord.API.DiscordSocketApiClient.ConnectAsync()
at Discord.WebSocket.DiscordSocketClient.OnConnectingAsync()
at Discord.ConnectionManager.ConnectAsync(CancellationTokenSource reconnectCancelToken)
at Discord.ConnectionManager.<>c__DisplayClass29_0.<<StartAsync>b__0>d.MoveNext()
This is the configuration part of the code:
_configuration = new ConfigurationBuilder()
.AddEnvironmentVariables(prefix: "!")
.AddJsonFile("bot_info.json", optional: true)
.Build();
Entire codebase: https://github.com/DudeThatsErin/csharpbot