Commit Graph

927 Commits

Author SHA1 Message Date
Vgr E. Barry
885889495a Properly handle the bot's nick being already in use 2016-11-16 16:18:37 -05:00
nyuszika7h
d62b9db896 Also abort if 'git status' fails 2016-11-16 15:04:05 +01:00
nyuszika7h
82d6760c5a !update: Don't restart the bot if already up-to-date 2016-11-16 14:59:29 +01:00
Vgr E. Barry
abd2dd149d Allow handle_error to decorate its instances 2016-11-16 08:20:02 -05:00
nyuszika7h
be2d33dbe6 Make traceback pastes not expire automatically
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).
2016-11-16 14:05:18 +01:00
Vgr E. Barry
3f806620e4 _ 2016-11-15 20:38:29 -05:00
Vgr E. Barry
3e61e9ec6a Beauty is in the eye of the tiger 2016-11-15 20:37:40 -05:00
Vgr E. Barry
360204bf43 Massively improve user handling
This changes how users are handled, making it less likely to encounter duplicate users; in normal circumstances, duplicates shouldn't happen.
2016-11-15 19:54:42 -05:00
jacob1
01924504fe Fix day never ending when the only votes are on the bot at day timeout 2016-11-14 23:34:09 -05:00
nyuszika7h
2c3aafc101 Improvements to !rules
* 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.
2016-11-13 11:54:48 +01:00
Trigonoculus
629fe51fd7 Make rules string unconfigured by default (#269)
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.
2016-11-13 11:32:30 +01:00
skizzerz
64e6a90921 *hic*
Make doctor immunize work against doomsayer sickness and pestilence
totem
2016-11-12 23:46:45 -06:00
Vgr E. Barry
e161325d01 Remove 'channels' from the user interface
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.
2016-11-10 10:44:38 -05:00
Vgr E. Barry
52b28b4317 Fix case-sensitiveness on weird IRCds 2016-11-08 17:04:32 -05:00
Ryan Schmidt
8039b5e2a1 Merge pull request #266 from lykoss/werecrow_kill
Allow werecrow to both observe and kill at the same time
2016-11-07 23:13:10 -07:00
jacob1
0c8afe4f64 Fix db error when adding a tempban sanction on a player that already has one, fixes #245
Can happen when doing it manually, or when adding a warning after it expired but before expire_tempbans() is called
2016-11-07 21:10:18 -05:00
jacob1
cd118dbabe allow werecrow to both observe and kill at the same time 2016-11-07 20:52:58 -05:00
Vgr E. Barry
d6f2882741 Fix syntax error
Turns out that's 3.5+
2016-11-06 22:18:17 -05:00
Vgr E. Barry
fb2ece45e6 Clean up some of doomsayer's code 2016-11-06 21:54:29 -05:00
Vgr E. Barry
7c753b2810 Improve the error handler
Also, thanks to @nyuszika7h for the uuid idea. I took his early draft and implemented it properly as part of the refactoring I did.
2016-11-06 21:43:01 -05:00
Vgr E. Barry
a39ded6053 Improve handling of fake contexts 2016-11-06 17:27:09 -05:00
Vgr E. Barry
61bca595c5 Fix small oversight 2016-11-06 17:26:46 -05:00
jacob1
3db042967d fix adding/removing tempbans to hostmasks 2016-11-05 11:40:16 -04:00
jacob1
fde2ce94db fix bot pinging fake players after !fstop 2016-11-05 11:13:35 -04:00
jacob1
5d0021de7d fix possible error when setting flags on users 2016-11-05 00:21:15 -04:00
nyuszika7h
e4f696abe6 Fix villagergame appearing above 9p
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.
2016-11-04 21:45:29 +01:00
jacob1
6293b61d83 fix error when villagergame kills someone with a retribution totem, fixes #224 2016-11-03 23:26:30 -04:00
jacob1
f101c62af8 Fix !fflags +j overwriting flags when account name is uppercase, fixes #254
Also allow setting flags on players that haven't played any games
2016-11-03 22:06:13 -04:00
nyuszika7h
136e41a14c Add newline for readability 2016-11-04 00:06:51 +01:00
skizzerz
341cce6a8f Split mayor
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
2016-11-03 16:29:15 -05:00
Vgr E. Barry
2244ed4370 Fix wrong function calls in user functions 2016-11-03 12:04:26 -04:00
Vgr E. Barry
a6424605ad Fix error when bot restarting and players were joined
AKA name error
2016-11-03 11:35:17 -04:00
Vgr E. Barry
cce2797e7b Fix name 2016-11-03 11:29:03 -04:00
Vgr E. Barry
851cebdbd7 Remove test function
Oops.
2016-11-03 11:26:39 -04:00
Vgr E. Barry
62abf6dae8 Fix small issues with fake nicks and channels 2016-11-02 23:35:13 -04:00
Vgr E. Barry
d090e573b7 Greatly improve channel handling
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!
2016-11-02 22:31:54 -04:00
Vgr E. Barry
49208db148 Make backwards-compatible users.add return the new "user" 2016-11-02 16:15:16 -04:00
Vgr E. Barry
04e7f952d3 Improve error handler 2016-11-02 15:18:32 -04:00
Vgr E. Barry
0120836669 Don't bother using a channel state in __del__
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.
2016-11-02 14:52:30 -04:00
Vgr E. Barry
b4fc7ac82d Remove leftover parameter 2016-11-02 14:34:33 -04:00
Vgr E. Barry
736d1219ed Fix oversight in account handling 2016-11-01 23:04:47 -04:00
nyuszika7h
6932c42574 Fix traceback syntax highlighting
Additional text at the end (local variables) has a red border for each
line with py3tb, but not with pytb.
2016-11-01 23:16:55 +01:00
nyuszika7h
dccfd9de38 Require "!leave -force" to quit during a game 2016-11-01 15:34:49 +01:00
Vgr E. Barry
b67043d25f Small tweaks 2016-10-31 22:25:20 -04:00
Vgr E. Barry
3de4469809 Comment out yet-to-be-tested hooks 2016-10-31 22:23:42 -04:00
Vgr E. Barry
fe141b288f Allow specifying a prefix (e.g. for channels) for context.send() 2016-10-31 22:22:48 -04:00
Vgr E. Barry
5c9b13ce87 Improve NOTICE handling
The `notice` parameter is now keyword-only, and the handler now uses `functools.partial` instead of a lambda function.
2016-10-31 20:59:52 -04:00
Vgr E. Barry
12eab068be Change the user handling calls in wolfgame.py 2016-10-31 20:44:10 -04:00
Vgr E. Barry
795caa83fe Forward fixes for the new interface 2016-10-31 17:57:48 -04:00
Ryan Schmidt
7e856859cb Merge pull request #250 from lykoss/irc-hooks
Add a new hooks.py file
2016-10-31 10:13:19 -07:00
jacob1
0a7752fd15 newline changes in error logger
local variables were right next to the next traceback in errors.log even though the belonged to the previous one
2016-10-30 23:02:50 -04:00
Vgr E. Barry
d602a33efd Update handle_error to be more useful
Now, local variables from the innermost frame (i.e. where the error was raised) are printed with the traceback, and the latter includes all of the call stack (instead of just up to the innermost error handler).
2016-10-30 22:34:46 -04:00
Vgr E. Barry
a2257ce692 Fix pastebin_tb to actually use the passed traceback 2016-10-30 22:32:54 -04:00
nyuszika7h
c968e1192a Even better exception printing, like in tracebacks 2016-10-30 20:12:15 +01:00
Vgr E. Barry
e5f922d548 Improve exception printing through !eval and !exec 2016-10-30 14:03:46 -04:00
nyuszika7h
57a628f135 Update help text for !say/!act
No longer requires !f prefix so display the preferred command names
in the help text.
2016-10-29 23:26:35 +02:00
skizzerz
21fc1f81c0 Fix error on attempting to warn with invalid expiration value 2016-10-28 17:19:12 -05:00
Vgr E. Barry
eef934c433 Custom keys can't fit in lykos. Tsk tsk @laneatomic 2016-10-28 14:37:17 -04:00
Vgr E. Barry
f3e1273dbc Add a new hooks.py file 2016-10-27 19:15:33 -04:00
Ryan Schmidt
af96a2544e Merge pull request #248 from lykoss/context-base-stuff
New IRCContext, Channel and User classes
2016-10-27 15:26:45 -07:00
Vgr E. Barry
317a5edab9 @skizzerz must *obviously* be an op! 2016-10-27 18:15:29 -04:00
nyuszika7h
5eba188607 Also fix idols when wild child itself changes nick 2016-10-27 20:49:56 +02:00
nyuszika7h
a0092b981f Update wild child's idol when they change nick
Closes #249.
2016-10-27 20:42:11 +02:00
Vgr E. Barry
349433c9ab Do a direct lookup for hostmasks for stasis. 2016-10-27 09:13:07 -04:00
Vgr E. Barry
2877abea55 Update as per @skizzerz's comments 2016-10-26 20:06:29 -04:00
skizzerz
430b73ef33 Re-do 85972db5 to not be utterly idiotic 2016-10-25 21:29:53 -05:00
Vgr E. Barry
85972db5b1 Update Event to allow arbitrary keyword arguments
Comments are on the same line as the possibly-failing line; if it fails,
the traceback will include that line (so it will be obvious what the
error is without looking at the source).
2016-10-25 21:25:33 -04:00
Vgr E. Barry
5ec273c6e0 New IRCContext, Channel and User classes
Right now these don't do anything, but in the future they will be how
we'll do channel and user handling.
2016-10-25 18:20:31 -04:00
nyuszika7h
0ad4af4240 Change !fstop back to require prefix
Per @skizzerz's comment on IRC, you're forcing the game to stop,
as it would also stop on its own when it ends normally.
2016-10-25 21:42:28 +02:00
nyuszika7h
281ac8e21e Don't require !f prefix for admin commands where unambiguous
I didn't change !fflags to !flags as it may be a good idea to add
a !flags command to allow users to view their own flags.
2016-10-25 21:07:47 +02:00
nyuszika7h
6ac05fb3e6 Make !update not pull if a game is running
The reason we defer pulling is because if an error happens before
restarting, the line numbers in the traceback may not reflect the
actual line numbers since the code has changed.
2016-10-25 17:49:10 +02:00
nyuszika7h
946e84cbd3 Add !update command 2016-10-25 17:00:50 +02:00
nyuszika7h
797d95fac8 Fixes to !fpull and !frestart 2016-10-25 16:38:46 +02:00
jacob1
1d664fae6b fix error when doing 'kill and', 'kill and 7' will try killing 'and' and '7' 2016-10-25 08:27:28 -04:00
jacob1
24c5e845d3 prevent bodyguard from guarding self, this shouldn't be possible 2016-10-24 23:04:02 -04:00
nyuszika7h
0580915150 Allow specifying lover wins with fool in !fgame roles 2016-10-24 17:25:51 +02:00
jacob1
430fa3c7c7 really fix role_attribution argument order in random 2016-10-22 22:16:56 -04:00
nyuszika7h
d0c19357df Fix wrong order of arguments 2016-10-22 17:59:21 +02:00
skizzerz
c2fd50a33e Fix piper !pass breaking the bot
Piper shouldn't be able to !pass anyway, so let's just remove that
entirely.
2016-10-20 16:47:26 -05:00
jacob1
ab8a05ac1b log errors to errors.log again 2016-10-19 21:01:41 -04:00
skizzerz
c8a5f804da Fix wolfteam VG killing protected people 2016-10-19 19:25:52 -05:00
nyuszika7h
684abf58b4 Minor code style fixes to previous commit
Making this a separate commit to avoid invalidating the PGP signature,
though it doesn't really matter for lykos anyway.
2016-10-19 21:48:41 +02:00
Lukas Martini
a6c6236e4f Stop start vote timer if player leaving is the only one who voted 2016-10-19 21:44:19 +02:00
skizzerz
55c70570af Switch param order of role_attribution event
Standardizing on first two params for event handlers to be cli, var
2016-10-18 21:56:56 -05:00
nyuszika7h
95133160ab Tell dullahan their role at night even if targets dead 2016-10-18 15:06:33 +02:00
jacob1
9c041e253c fix "you are a cursedtraitor"
also add tags support to all the other wolf roles in case we do that sometime
2016-10-15 22:16:35 -04:00
Ryan Schmidt
4e8f083dc2 Make !refreshdb expire stasis and tempbans
It was slightly annoying that there was no way to do this via a command. Should also have these expire if someone !quits to end a game, someone should work on that :)
2016-10-13 15:04:30 -07:00
Vgr E. Barry
6b9453afa1 Use more specific OS exceptions
Python 3.3 added some more specific exceptions for OS-related
operations, specifically to help mitigate this kind of hard-to-read
boilerplate. See
https://docs.python.org/3/whatsnew/3.3.html#pep-3151-reworking-the-os-and-io-exception-hierarchy
for reference.
2016-10-08 08:47:23 -04:00
nyuszika7h
36b5543d24 Remove !wiki title check as it is too restrictive
It didn't allow user pages or pages with disambiguation suffixes.
I think it's fine for it to just return "not found" for invalid titles.
2016-09-26 16:32:18 +02:00
Vgr E. Barry
925819e517 Remove stray cat from busy street 2016-09-26 07:11:12 -04:00
jacob1
5ef750aa2e Update !wiki to use the new wiki 2016-09-25 23:39:38 -04:00
skizzerz
2dac49f741 Fix dullahan spine whip breaking due to FA split 2016-09-25 19:39:52 -05:00
nyuszika7h
12edbdfb43 Make "!gstats <num>" also show total of all gamemodes
Also capitalized the role names and "Total wins" for consistency with
!pstats and upgraded the schema to create a new index for game lookups
without specifying the game mode.
2016-09-24 23:22:33 +02:00
jacob1
3ce7e1d72f fix error in !gamestats # 2016-09-24 15:31:46 -04:00
nyuszika7h
e0bf47c182 Make !gstats show totals for all game modes by default 2016-09-24 12:27:45 +02:00
skizzerz
810433b656 Revamp alpha
Make 10+ because it's pointless otherwise.

Revamp low counts because it was too punishing towards village, if they
made a single mistake then alpha could win with a successful bite. This
reduces overall wolf count making that situation more difficult (and
until crow joins in 12p requires that alpha turns a lycan before being
able to bite). Higher counts rejiggered a bit too to be a bit more
interesting, although may still need further adjustment.
2016-09-23 23:28:28 -05:00
skizzerz
bfc675e953 Split fallen angel
Also fixes some bugs with using stop_propagation instead of
stop_processing in events (the former does absolutely nothing).

Added a skeleton file to assist with adding new roles, contains the
needed imports on top and vim modeline on the bottom.

Yes, these are all related and need to go in the same commit, stop
throwing things at me.
2016-09-23 20:10:04 -05:00
skizzerz
9f21eb65c3 Fix gstats reporting 'foo wins' 2016-09-23 18:52:21 -05:00
nyuszika7h
5a20801209 Mention game mode in !gstats output
This is to make it clear that !gstats without arguments returns stats
only for the default game mode.
2016-09-23 15:14:27 +02:00
skizzerz
1bce120e1c Remove cursed and mayor from evilvillage
Both templates serve to make life miserable for village team, who
already have it rough as-is. Cursed makes it so that hunter's sole shot
misses half the time, and mayor makes it so that fakeclaiming has less
of a chance of working out (and wolf kills the fakeclaimer the next
night thus ending any confusion).
2016-09-17 13:29:17 -05:00