flapjax / FlapJack-Cogs

Custom cogs for Red Bot
MIT License
36 stars 38 forks source link

[ReactPoll] Fixed unintended behavior in rpollset embed #139

Closed trumoose closed 2 years ago

trumoose commented 2 years ago

In the current branch, .rpollset embed doesn't behave correctly when no votes are received -- it also sends in two separate messages with the question and NO ONE VOTED message: one that obeys the current rpollset embed setting, and one that doesn't. (see below for examples.)

To rectify this, the code block responsible has been greatly simplified, and sending the message happens in one place at the end of the method instead of at the middle and at the end. I'm welcome to suggestions for formatting changes, but the logic itself should be sound.

CURRENT BRANCH BEHAVIOR:

PR BRANCH BEHAVIOR:

aikaterna commented 2 years ago

The issue could have been fixed by just adding a "not" on line 225, if self.embed: -> if not self.embed:, but your changes condensed the 3 message sends into one message, and I agree with that change.