diff --git a/Commands/Polls.cs b/Commands/Polls.cs index bb223ac..d07af82 100644 --- a/Commands/Polls.cs +++ b/Commands/Polls.cs @@ -27,9 +27,7 @@ namespace dotbot.Commands { var pollId = Context.Channel.Id; if (_polls.ContainsKey(pollId)) - { await ReplyAsync($"respond with some more options or start the poll with `{_config["prefix"]}poll start`"); - } else { _polls[pollId] = new Poll diff --git a/Services/PollService.cs b/Services/PollService.cs index bf8f2e3..ef9fc60 100644 --- a/Services/PollService.cs +++ b/Services/PollService.cs @@ -9,20 +9,20 @@ namespace dotbot.Services { public class PollService { - private readonly ulong _selfId; + private DiscordSocketClient _discord; public Dictionary currentPolls; public PollService(DiscordSocketClient discord) { currentPolls = new Dictionary(); - discord.ReactionAdded += OnReactionAddedAsync; - _selfId = discord.CurrentUser.Id; + _discord = discord; + _discord.ReactionAdded += OnReactionAddedAsync; } private Task OnReactionAddedAsync(Cacheable CachedMessage, ISocketMessageChannel Channel, SocketReaction Reaction) { - if (currentPolls.ContainsKey(Channel.Id) && Reaction.UserId != _selfId) + if (currentPolls.ContainsKey(Channel.Id) && Reaction.UserId != _discord.CurrentUser.Id) currentPolls[Channel.Id].Options.First(o => o.MessageId == Reaction.MessageId).Votes++; return Task.CompletedTask; }