diff options
| author | 2018-10-28 12:44:48 +0000 | |
|---|---|---|
| committer | 2018-10-28 12:44:48 +0000 | |
| commit | 85f86f9d8a7baea91bb7c643955561d8535ced42 (patch) | |
| tree | 4d6dcfe480cba508727cbc29a103ff7d6257e8bf | |
| parent | Fix wording for !badwordsdel (copypaste fail!) (diff) | |
| signature | ||
Pretend badwords list is zero-indexed
| -rw-r--r-- | modules/badwords.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/badwords.py b/modules/badwords.py index daf7fbc8..4948a822 100644 --- a/modules/badwords.py +++ b/modules/badwords.py @@ -9,7 +9,7 @@ class Module(ModuleManager.BaseModule): :require_mode: o """ badwords = event["target"].get_setting("badwords", []) - badwords = ("(%d) %s" % (i, badword["pattern"]) for i, badword in + badwords = ("(%d) %s" % (i+1, badword["pattern"]) for i, badword in enumerate(badwords)) event["stdout"].write("%s: %s" % (event["target"].name, ", ".join(badwords))) @@ -51,6 +51,7 @@ class Module(ModuleManager.BaseModule): if index_int >= len(badwords): raise utils.EventError("%s: unknown badwords index %s" % ( event["user"].nickname, index)) + badwords.pop(index_int) event["target"].set_setting("badwords", badwords) event["stdout"].write("%s: removed from badwords" % |
