diff --git a/NadekoBot/Modules/Administration/Commands/ServerGreetCommand.cs b/NadekoBot/Modules/Administration/Commands/ServerGreetCommand.cs index 398ce975..f5c3af29 100644 --- a/NadekoBot/Modules/Administration/Commands/ServerGreetCommand.cs +++ b/NadekoBot/Modules/Administration/Commands/ServerGreetCommand.cs @@ -245,13 +245,18 @@ namespace NadekoBot.Modules.Administration.Commands }); cgb.CreateCommand(Module.Prefix + "greetmsg") - .Description("Sets a new announce message. Type %user% if you want to mention the new member.\n**Usage**: .greetmsg Welcome to the server, %user%.") + .Description("Sets a new announce message. Type %user% if you want to mention the new member. Using it with no message will show the current greet message.\n**Usage**: .greetmsg Welcome to the server, %user%.") .Parameter("msg", ParameterType.Unparsed) .Do(async e => { if (!e.User.ServerPermissions.ManageServer) return; - if (e.GetArg("msg") == null) return; var ann = AnnouncementsDictionary.GetOrAdd(e.Server.Id, new AnnounceControls(e.Server.Id)); + if (string.IsNullOrWhiteSpace(e.GetArg("msg"))) + { + await e.Channel.SendMessage("`Current greet message:` " + ann.GreetText); + return; + } + ann.GreetText = e.GetArg("msg"); await e.Channel.SendMessage("New greet message set.").ConfigureAwait(false); @@ -273,13 +278,17 @@ namespace NadekoBot.Modules.Administration.Commands }); cgb.CreateCommand(Module.Prefix + "byemsg") - .Description("Sets a new announce leave message. Type %user% if you want to mention the new member.\n**Usage**: .byemsg %user% has left the server.") + .Description("Sets a new announce leave message. Type %user% if you want to mention the new member. Using it with no message will show the current bye message.\n**Usage**: .byemsg %user% has left the server.") .Parameter("msg", ParameterType.Unparsed) .Do(async e => { if (!e.User.ServerPermissions.ManageServer) return; - if (e.GetArg("msg") == null) return; var ann = AnnouncementsDictionary.GetOrAdd(e.Server.Id, new AnnounceControls(e.Server.Id)); + if (string.IsNullOrWhiteSpace(e.GetArg("msg"))) + { + await e.Channel.SendMessage("`Current bye message:` " + ann.ByeText); + return; + } ann.ByeText = e.GetArg("msg"); await e.Channel.SendMessage("New bye message set.").ConfigureAwait(false);