parent
e451041f05
commit
a1b2055127
1 changed files with 12 additions and 4 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue