poll is now public poll, private poll removed

This commit is contained in:
Master Kwoth
2017-06-24 07:23:59 +02:00
parent 7ad5c5e02b
commit e27e1005eb
8 changed files with 64 additions and 106 deletions

View File

@ -26,13 +26,7 @@ namespace NadekoBot.Modules.Games
[RequireUserPermission(GuildPermission.ManageMessages)]
[RequireContext(ContextType.Guild)]
public Task Poll([Remainder] string arg = null)
=> InternalStartPoll(arg, false);
[NadekoCommand, Usage, Description, Aliases]
[RequireUserPermission(GuildPermission.ManageMessages)]
[RequireContext(ContextType.Guild)]
public Task PublicPoll([Remainder] string arg = null)
=> InternalStartPoll(arg, true);
=> InternalStartPoll(arg);
[NadekoCommand, Usage, Description, Aliases]
[RequireUserPermission(GuildPermission.ManageMessages)]
@ -44,15 +38,10 @@ namespace NadekoBot.Modules.Games
await Context.Channel.EmbedAsync(poll.GetStats(GetText("current_poll_results")));
}
//todo enable private polls, or completely remove them
private async Task InternalStartPoll(string arg, bool isPublic = false)
private async Task InternalStartPoll(string arg)
{
if (isPublic == false)
{
await ReplyErrorLocalized($"Temporarily disabled. Use `{Prefix}ppoll`");
return;
}
if(await _polls.StartPoll((ITextChannel)Context.Channel, Context.Message, arg, isPublic) == false)
if(await _polls.StartPoll((ITextChannel)Context.Channel, Context.Message, arg) == false)
await ReplyErrorLocalized("poll_already_running").ConfigureAwait(false);
}