static async Task MainAsync(string[] args) { await EBotCredentials.Load(); EBotClient client = new EBotClient(EBotCredentials.TOKEN_MAIN, "_"); await client.ConnectAsync(); await Task.Delay(-1); }
public static async Task Load() { using (StreamReader reader = File.OpenText("External/credentials.json")) { string json = await reader.ReadToEndAsync(); EBotCredentials credentials = JsonConvert.DeserializeObject <EBotCredentials>(json); TOKEN_DEV = credentials.TokenDev; TOKEN_MAIN = credentials.TokenMain; TWITCH_URL = credentials.TwitchURL; BOT_ID_MAIN = credentials.BotIDMain; BOT_ID_DEV = credentials.BotIDDev; OWNER_ID = credentials.OwnerID; GOOGLE_API_KEY = credentials.GoogleAPIKey; } }