.connectshard added

This commit is contained in:
Kwoth
2017-02-04 18:45:07 +01:00
parent aaa82dfdfe
commit 58f23ff40b
3 changed files with 59 additions and 0 deletions

View File

@@ -16,6 +16,29 @@ namespace NadekoBot.Modules.Administration
[Group]
class SelfCommands : ModuleBase
{
[NadekoCommand, Usage, Description, Aliases]
[OwnerOnly]
public async Task ConnectShard(int shardid)
{
var shard = NadekoBot.Client.GetShard(shardid);
if (shard == null)
{
await Context.Channel.SendErrorAsync("No shard by that id found.").ConfigureAwait(false);
return;
}
try
{
await Context.Channel.SendConfirmAsync($"Shard **#{shardid}** reconnecting.").ConfigureAwait(false);
await shard.ConnectAsync().ConfigureAwait(false);
await Context.Channel.SendConfirmAsync($"Shard **#{shardid}** reconnected.").ConfigureAwait(false);
}
catch (Exception ex)
{
_log.Warn(ex);
}
}
[NadekoCommand, Usage, Description, Aliases]
[OwnerOnly]
public async Task Leave([Remainder] string guildStr)