diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/stoi.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/plugins/stoi.py b/plugins/stoi.py index 56440db5..f0b863fe 100644 --- a/plugins/stoi.py +++ b/plugins/stoi.py @@ -21,6 +21,7 @@ from plugin import BasePlugin import tabs import string import xhtml +import random char_we_dont_want = string.punctuation+' ’„“”…«»' @@ -29,9 +30,10 @@ class Plugin(BasePlugin): for tab_type in (tabs.MucTab, tabs.PrivateTab, tabs.ConversationTab): self.api.add_tab_command(tab_type, 'stoi', handler=self.stoi, - help="Repeats the last word of the last message " - "in the conversation, and use it in an " - "annoying “C’est toi le” sentence.", + help="Repeats the last word of the last " + "message in the conversation, and " + "use it in an annoying “C’est toi " + "le” sentence.", short='C’est toi le stoi.') def stoi(self, args): @@ -47,4 +49,10 @@ class Plugin(BasePlugin): last_word = txt.split()[-1] else: last_word = "vide" - self.api.send_message("C’est toi le %s." % last_word) + intro = "C'est toi " if random.getrandbits(1) else "Stoi " + if last_word[0] in 'aeiouAEIOUÀàÉéÈè': + msg = intro + ('l’%s' % last_word) + else: + msg = intro + ('le %s' % last_word) + self.api.send_message(msg) + |