.rafflecur added
This commit is contained in:
@ -39,7 +39,7 @@ namespace NadekoBot.Modules.Games
|
||||
|
||||
private async Task InternalStartPoll(string arg)
|
||||
{
|
||||
if(await _service.StartPoll((ITextChannel)Context.Channel, Context.Message, arg) == false)
|
||||
if(await _service.StartPoll(Context.Channel.Id, Context.Message, arg) == false)
|
||||
await ReplyErrorLocalized("poll_already_running").ConfigureAwait(false);
|
||||
}
|
||||
|
||||
@ -53,8 +53,6 @@ namespace NadekoBot.Modules.Games
|
||||
_service.ActivePolls.TryRemove(channel.Guild.Id, out var poll);
|
||||
await poll.StopPoll().ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -26,7 +26,7 @@ namespace NadekoBot.Modules.Games.Services
|
||||
_strings = strings;
|
||||
}
|
||||
|
||||
public async Task<bool?> StartPoll(ITextChannel channel, IUserMessage msg, string arg)
|
||||
public async Task<bool?> StartPoll(ulong guildId, IUserMessage msg, string arg)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(arg) || !arg.Contains(";"))
|
||||
return null;
|
||||
@ -35,7 +35,7 @@ namespace NadekoBot.Modules.Games.Services
|
||||
return null;
|
||||
|
||||
var poll = new Poll(_client, _strings, msg, data[0], data.Skip(1));
|
||||
if (ActivePolls.TryAdd(channel.Guild.Id, poll))
|
||||
if (ActivePolls.TryAdd(guildId, poll))
|
||||
{
|
||||
poll.OnEnded += (gid) =>
|
||||
{
|
||||
|
Reference in New Issue
Block a user