summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2014-04-10 19:34:26 +0200
committermathieui <mathieui@mathieui.net>2014-04-10 19:34:26 +0200
commita1b20551276f2017256453304216988d6f094bd8 (patch)
tree04af22f8b5b11500b0d80436dd45e4dc2605d466 /plugins
parente451041f05e17e03e459a62933274837d00835b1 (diff)
downloadpoezio-a1b20551276f2017256453304216988d6f094bd8.tar.gz
poezio-a1b20551276f2017256453304216988d6f094bd8.tar.bz2
poezio-a1b20551276f2017256453304216988d6f094bd8.tar.xz
poezio-a1b20551276f2017256453304216988d6f094bd8.zip
Fix #2500 (better “C’est toi le”)
Thanks, anonymous contributor
Diffstat (limited to 'plugins')
-rw-r--r--plugins/stoi.py16
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)
+