From 221d5d90287946ce34b835949f7f2d7f49d78f1b Mon Sep 17 00:00:00 2001 From: Master Kwoth Date: Sat, 4 Jun 2016 07:45:20 +0200 Subject: [PATCH] .leave commands added --- .../Administration/AdministrationModule.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/NadekoBot/Modules/Administration/AdministrationModule.cs b/NadekoBot/Modules/Administration/AdministrationModule.cs index 8e0c6b16..fc907cac 100644 --- a/NadekoBot/Modules/Administration/AdministrationModule.cs +++ b/NadekoBot/Modules/Administration/AdministrationModule.cs @@ -1000,6 +1000,21 @@ namespace NadekoBot.Modules.Administration await e.Channel.SendMessage("```xl\n" + string.Join("\n", arr.GroupBy(item => (i++) / 3).Select(ig => string.Join("", ig.Select(el => $"• {el,-35}")))) + "\n```"); }); + cgb.CreateCommand(Prefix + "leave") + .Description("Leaves a server with a supplied ID.\n**Usage**: `.leave 493243292839`") + .Parameter("num", ParameterType.Required) + .AddCheck(SimpleCheckers.OwnerOnly()) + .Do(async e => + { + var srvr = NadekoBot.Client.Servers.Where(s => s.Id.ToString() == e.GetArg("num").Trim()).FirstOrDefault(); + if (srvr == null) + { + return; + } + await srvr.Leave(); + await e.Channel.SendMessage("`Done.`"); + }); + }); }