summaryrefslogtreecommitdiff
path: root/plugins/cyber.py
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/cyber.py')
-rw-r--r--plugins/cyber.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/cyber.py b/plugins/cyber.py
index cb6e0371..c7d4aba7 100644
--- a/plugins/cyber.py
+++ b/plugins/cyber.py
@@ -21,9 +21,9 @@ from poezio.plugin import BasePlugin
from random import choice, randint
import re
-
DEFAULT_CONFIG = {'cyber': {'frequency': 10}}
+
class Plugin(BasePlugin):
default_config = DEFAULT_CONFIG
@@ -34,7 +34,9 @@ class Plugin(BasePlugin):
def cyberize(self, msg, tab):
if randint(1, 100) > self.config.get('frequency'):
return
- words = [word for word in re.split('\W+', msg['body']) if len(word) > 3]
+ words = [
+ word for word in re.split('\W+', msg['body']) if len(word) > 3
+ ]
if words:
word = choice(words)
msg['body'] = msg['body'].replace(word, 'cyber' + word)