From 22aba88de5f0c2faac63ee8dcd17835270ce0cf3 Mon Sep 17 00:00:00 2001 From: Master Kwoth Date: Sun, 24 Jan 2016 13:24:18 +0100 Subject: [PATCH 1/3] required param cannot be null --- NadekoBot/Modules/Administration.cs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/NadekoBot/Modules/Administration.cs b/NadekoBot/Modules/Administration.cs index 0bba2021..5a3e60ee 100644 --- a/NadekoBot/Modules/Administration.cs +++ b/NadekoBot/Modules/Administration.cs @@ -313,16 +313,14 @@ namespace NadekoBot.Modules await client.CurrentUser.Edit(NadekoBot.password, e.GetArg("new_name")); }); - cgb.CreateCommand(".setgame") - .Description("Sets the bots game.") - .Parameter("set_game", ParameterType.Required) - .Do( e => { - if (e.User.Id != NadekoBot.OwnerID || e.GetArg("set_game") == null) return; + cgb.CreateCommand(".setgame") + .Description("Sets the bots game.") + .Parameter("set_game", ParameterType.Required) + .Do(e => { + if (e.User.Id != NadekoBot.OwnerID) return; - client.SetGame(e.GetArg("set_game")); - }); - - + client.SetGame(e.GetArg("set_game")); + }); cgb.CreateCommand(".checkmyperms") .Description("Checks your userspecific permissions on this channel.") From 21b22add1855148a1f98af6dc21839f31c5111ff Mon Sep 17 00:00:00 2001 From: Master Kwoth Date: Sun, 24 Jan 2016 14:01:09 +0100 Subject: [PATCH 2/3] announce message clarification, setgame fixed --- NadekoBot/Commands/ServerGreetCommand.cs | 4 ++++ NadekoBot/Modules/Administration.cs | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/NadekoBot/Commands/ServerGreetCommand.cs b/NadekoBot/Commands/ServerGreetCommand.cs index 5d8ea590..bb91c93d 100644 --- a/NadekoBot/Commands/ServerGreetCommand.cs +++ b/NadekoBot/Commands/ServerGreetCommand.cs @@ -197,6 +197,8 @@ namespace NadekoBot.Commands { AnnouncementsDictionary[e.Server.Id].GreetText = e.GetArg("msg"); await e.Send("New greet message set."); + if (!AnnouncementsDictionary[e.Server.Id].Greet) + await e.Send("Enable greet messsages by typing `.greet`"); }); cgb.CreateCommand(".bye") @@ -225,6 +227,8 @@ namespace NadekoBot.Commands { AnnouncementsDictionary[e.Server.Id].ByeText = e.GetArg("msg"); await e.Send("New bye message set."); + if (!AnnouncementsDictionary[e.Server.Id].Bye) + await e.Send("Enable bye messsages by typing `.bye`"); }); } } diff --git a/NadekoBot/Modules/Administration.cs b/NadekoBot/Modules/Administration.cs index 5a3e60ee..85e37cf0 100644 --- a/NadekoBot/Modules/Administration.cs +++ b/NadekoBot/Modules/Administration.cs @@ -315,9 +315,9 @@ namespace NadekoBot.Modules cgb.CreateCommand(".setgame") .Description("Sets the bots game.") - .Parameter("set_game", ParameterType.Required) + .Parameter("set_game", ParameterType.Unparsed) .Do(e => { - if (e.User.Id != NadekoBot.OwnerID) return; + if (e.User.Id != NadekoBot.OwnerID || e.GetArg("set_game") != null) return; client.SetGame(e.GetArg("set_game")); }); From 796fa106258eba594d04365d432c272b83a79ba3 Mon Sep 17 00:00:00 2001 From: Master Kwoth Date: Sun, 24 Jan 2016 14:07:42 +0100 Subject: [PATCH 3/3] ffs setgame fixed 101% now --- NadekoBot/Modules/Administration.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NadekoBot/Modules/Administration.cs b/NadekoBot/Modules/Administration.cs index 85e37cf0..12ea9f9d 100644 --- a/NadekoBot/Modules/Administration.cs +++ b/NadekoBot/Modules/Administration.cs @@ -317,7 +317,7 @@ namespace NadekoBot.Modules .Description("Sets the bots game.") .Parameter("set_game", ParameterType.Unparsed) .Do(e => { - if (e.User.Id != NadekoBot.OwnerID || e.GetArg("set_game") != null) return; + if (e.User.Id != NadekoBot.OwnerID || e.GetArg("set_game") == null) return; client.SetGame(e.GetArg("set_game")); });