forked from martinkirch/tofbot
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
9 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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()) |