As part of this, adjust team and accurate stats to no longer hide any
information. For team stats in particular, it was very misleading to
list traitor as villager, because it gives the village the impression
they have more time than they actually do (i.e. 2 wolfteam 5 vilteam
actually means 3 wolfteam 4 vilteam but that is not obvious). As team
stats were changed, team reveal was also changed to disregard hidden
traitor, so that the two can't be correlated to pick out if traitor died
(if traitor was revealed as vilteam but stats decremented wolfteam, that
would guarantee that traitor died).
Also commit groundwork for the stats rewrite, hidden behind an
"experimental" stats type (so it is not on by default). It is still very
WIP, many things do not yet work with it.
Since we have the UUID now, we can delete them at any time if needed,
they don't have to expire automatically, which can be annoying when
trying to look up an old error (although it's also in errors.log).
* RULES is now not defined in settings.py, only in botconfig.py.
* If there are no rules specified, a default message is shown
instructing users to configure it.
* The "#CHANNEL channel rules: " prefix is now automatically prepended
(skipped if the string already contains that,
for backwards-compatibility).
* The prefix and the no-rules message can be customized
as they are in messages.py now.
The old link was outdated anyway, and other networks may not use the same rules as freenode, so it should be just configured in botconfig.py like it always could.
We don't use it, as the only places where we'd need to, it's only one channel, and the surrounding code needs to add the user to the channel and vice-versa, so that's pretty pointless.
In join phase, var.PLAYERS is empty, so var.ALL_PLAYERS needs to be
checked instead.
(While I'm at it, changed it to <= 9 rather than < 10, just for
consistency with the rest of the code.)
Fixes#263.
Also adjust revealing totem so that it always fires after mayor, in case
someone has both. Before it would depend on the order the files were
imported, which could lead to oddities down the road.
This fixes#256
This also does some more bits of rudimentary user handling, but most of it still remains to be done.
Note: This adds DEV_PREFIX to botconfig and LOG_PREFIX to settings (var), make sure to properly update your bot!
If the channel is being deleted, we don't need to care about the state. Furthermore, if the channel is being deleted as Python is shutting down, _States will have been deleted (or set to None), so we can't access it. Rather than trying to work around the garbage collection, we just set it to None and call it a day.