reason was not working, removed it for now

This commit is contained in:
Master Kwoth 2016-01-28 13:20:14 +01:00
parent 9ccc01c4a6
commit efa1dbb9db

View File

@ -259,7 +259,7 @@ namespace NadekoBot.Modules
.Parameter("user", ParameterType.Optional) .Parameter("user", ParameterType.Optional)
.Do(async e => { .Do(async e => {
var usr = e.User; var usr = e.User;
if(e.GetArg("user") != null) e.Channel.FindUsers(e.GetArg("user")).FirstOrDefault(); if(e.GetArg("user") != null) usr = e.Channel.FindUsers(e.GetArg("user")).FirstOrDefault();
await e.Send($"Id of the user { usr.Name } is { usr.Id }"); await e.Send($"Id of the user { usr.Name } is { usr.Id }");
}); });
@ -310,7 +310,6 @@ namespace NadekoBot.Modules
cgb.CreateCommand(".die") cgb.CreateCommand(".die")
.Alias(".graceful") .Alias(".graceful")
.Parameter("reason",ParameterType.Unparsed)
.Description("Works only for the owner. Shuts the bot down and notifies users about the restart.") .Description("Works only for the owner. Shuts the bot down and notifies users about the restart.")
.Do(async e => { .Do(async e => {
if (e.User.Id == NadekoBot.OwnerID) { if (e.User.Id == NadekoBot.OwnerID) {
@ -318,13 +317,6 @@ namespace NadekoBot.Modules
t.Interval = 2000; t.Interval = 2000;
t.Elapsed += (s, ev) => { Environment.Exit(0); }; t.Elapsed += (s, ev) => { Environment.Exit(0); };
t.Start(); t.Start();
string reason = e.GetArg("reason");
if (reason == null)
reason = "Unspecified.";
foreach (var kvp in Music.musicPlayers) {
if(kvp.Value?.CurrentSong?.Channel!=null)
await kvp.Value.CurrentSong.Channel.Send($"Owner initiated a shutdown, sorry for the interruption.\nReason: `{reason}`");
}
await e.Send("`Shutting down.`"); await e.Send("`Shutting down.`");
} }
}); });