From cca04ed2a2795f52d1389e32b6c196e2e0d929df Mon Sep 17 00:00:00 2001 From: Master Kwoth Date: Tue, 3 May 2016 18:43:40 +0200 Subject: [PATCH] .schn command added (set channel name) --- .../Modules/Administration/AdministrationModule.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/NadekoBot/Modules/Administration/AdministrationModule.cs b/NadekoBot/Modules/Administration/AdministrationModule.cs index a70bcee0..4f8d9ea1 100644 --- a/NadekoBot/Modules/Administration/AdministrationModule.cs +++ b/NadekoBot/Modules/Administration/AdministrationModule.cs @@ -511,6 +511,20 @@ namespace NadekoBot.Modules.Administration await e.Channel.SendMessage(":ok: **New channel topic set.**").ConfigureAwait(false); }); + cgb.CreateCommand(Prefix + "schn").Alias(Prefix + "setchannelname") + .Alias(Prefix + "topic") + .Description("Changed the name of the current channel.") + .AddCheck(SimpleCheckers.ManageChannels()) + .Parameter("name", ParameterType.Unparsed) + .Do(async e => + { + var name = e.GetArg("name"); + if (string.IsNullOrWhiteSpace(name)) + return; + await e.Channel.Edit(name: name).ConfigureAwait(false); + await e.Channel.SendMessage(":ok: **New channel name set.**").ConfigureAwait(false); + }); + cgb.CreateCommand(Prefix + "uid").Alias(Prefix + "userid") .Description("Shows user ID.") .Parameter("user", ParameterType.Unparsed)