diff --git a/NadekoBot/Commands/PollCommand.cs b/NadekoBot/Commands/PollCommand.cs index 055ef72c..dd25b5f4 100644 --- a/NadekoBot/Commands/PollCommand.cs +++ b/NadekoBot/Commands/PollCommand.cs @@ -21,6 +21,8 @@ namespace NadekoBot.Modules { .Description("Creates a poll, only person who has manage server permission can do it.\n**Usage**: >poll What is my question?;Answer1;Answer 2; Answer 3") .Parameter("allargs", ParameterType.Unparsed) .Do(e => { + if (!e.User.ServerPermissions.ManageChannels) + return; if (ActivePolls.ContainsKey(e.Server)) return; var arg = e.GetArg("allargs"); @@ -35,6 +37,8 @@ namespace NadekoBot.Modules { cgb.CreateCommand(">pollend") .Description("Stops active poll on this server and prints the results in this channel.") .Do(async e => { + if (!e.User.ServerPermissions.ManageChannels) + return; if (!ActivePolls.ContainsKey(e.Server)) return; await ActivePolls[e.Server].StopPoll(e.Channel); diff --git a/NadekoBot/Modules/Games.cs b/NadekoBot/Modules/Games.cs index 41b6f11a..35228c9e 100644 --- a/NadekoBot/Modules/Games.cs +++ b/NadekoBot/Modules/Games.cs @@ -23,6 +23,20 @@ namespace NadekoBot.Modules manager.CreateCommands("", cgb => { commands.ForEach(cmd => cmd.Init(cgb)); + + cgb.CreateCommand(">choose") + .Description("Chooses a thing from a list of things\n**Usage**: >choose Get up;Sleep more;Sleep even more") + .Parameter("list", Discord.Commands.ParameterType.Unparsed) + .Do(async e => { + var arg = e.GetArg("list"); + if (string.IsNullOrWhiteSpace(arg)) + return; + var list = arg.Split(';'); + if (list.Count() < 2) + return; + await e.Send(list[new Random().Next(0, list.Length)]); + }); + cgb.CreateCommand(">") .Description("Attack a person. Supported attacks: 'splash', 'strike', 'burn', 'surge'.\n**Usage**: > strike @User") .Parameter("attack_type",Discord.Commands.ParameterType.Required)