Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Clean plugins/eightball.py

  • Loading branch information...
commit b35e4e7a5bbd6d09ca27e2824c721fb3e36410d9 1 parent b3e5a37
@emillon emillon authored
Showing with 9 additions and 4 deletions.
  1. +9 −4 plugins/eightball.py
View
13 plugins/eightball.py
@@ -1,21 +1,26 @@
# -*- coding: utf-8 -*-
+"See PluginEuler"
+
from toflib import Plugin, InnocentHand
class PluginEuler(Plugin):
+ "Magic 8 ball plugin"
def __init__(self, bot):
Plugin.__init__(self, bot)
balldata = [ "Essaye plus tard" , "Essaye encore" , "Pas d'avis"
- , "C'est ton destin" , "Le sort en est jeté" , "Une chance sur deux"
- , "Repose ta question" , "D'après moi oui" , "C'est certain"
- , "Oui absolument" , "Tu peux compter dessus" , "Sans aucun doute"
+ , "C'est ton destin" , "Le sort en est jeté"
+ , "Une chance sur deux" , "Repose ta question"
+ , "D'après moi oui" , "C'est certain" , "Oui absolument"
+ , "Tu peux compter dessus" , "Sans aucun doute"
, "Très probable" , "Oui" , "C'est bien parti"
, "C'est non" , "Peu probable" , "Faut pas rêver"
, "N'y compte pas" , "Impossible"
]
self.ball = InnocentHand(balldata)
- def handle_msg(self, msg_text, chan, nick):
+ def handle_msg(self, msg_text, _chan, _nick):
+ "Reply with a 8 ball answer if input looks like a question"
msg_text = msg_text.lower().strip()
if msg_text.startswith("boule magique") and msg_text.endswith("?"):
self.say(self.ball())
Please sign in to comment.
Something went wrong with that request. Please try again.