runasync -> runandblockasync, runasync is not blocking now (unused)
This commit is contained in:
parent
b5fa858cbf
commit
0943a44c28
@ -49,7 +49,7 @@ namespace NadekoBot
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task RunAsync(string[] args)
|
public async Task RunAsync(params string[] args)
|
||||||
{
|
{
|
||||||
SetupLogger();
|
SetupLogger();
|
||||||
_log = LogManager.GetCurrentClassLogger();
|
_log = LogManager.GetCurrentClassLogger();
|
||||||
@ -60,7 +60,7 @@ namespace NadekoBot
|
|||||||
Credentials = new BotCredentials();
|
Credentials = new BotCredentials();
|
||||||
|
|
||||||
//create client
|
//create client
|
||||||
Client = new ShardedDiscordClient (new DiscordSocketConfig
|
Client = new ShardedDiscordClient(new DiscordSocketConfig
|
||||||
{
|
{
|
||||||
AudioMode = Discord.Audio.AudioMode.Outgoing,
|
AudioMode = Discord.Audio.AudioMode.Outgoing,
|
||||||
MessageCacheSize = 10,
|
MessageCacheSize = 10,
|
||||||
@ -79,7 +79,7 @@ namespace NadekoBot
|
|||||||
//setup DI
|
//setup DI
|
||||||
var depMap = new DependencyMap();
|
var depMap = new DependencyMap();
|
||||||
depMap.Add<ILocalization>(Localizer);
|
depMap.Add<ILocalization>(Localizer);
|
||||||
depMap.Add<ShardedDiscordClient >(Client);
|
depMap.Add<ShardedDiscordClient>(Client);
|
||||||
depMap.Add<CommandService>(CommandService);
|
depMap.Add<CommandService>(CommandService);
|
||||||
depMap.Add<IGoogleApiService>(Google);
|
depMap.Add<IGoogleApiService>(Google);
|
||||||
|
|
||||||
@ -111,8 +111,12 @@ namespace NadekoBot
|
|||||||
#endif
|
#endif
|
||||||
Ready = true;
|
Ready = true;
|
||||||
Console.WriteLine(await Stats.Print().ConfigureAwait(false));
|
Console.WriteLine(await Stats.Print().ConfigureAwait(false));
|
||||||
|
}
|
||||||
|
|
||||||
await Task.Delay(-1);
|
public async Task RunAndBlockAsync(params string[] args)
|
||||||
|
{
|
||||||
|
await RunAsync(args).ConfigureAwait(false);
|
||||||
|
await Task.Delay(-1).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SetupLogger()
|
private void SetupLogger()
|
||||||
|
Loading…
Reference in New Issue
Block a user