.. _fbf.plugs.extra.8b: 8b ~~ .. automodule:: fbf.plugs.extra.8b :show-inheritance: :members: :undoc-members: CODE ---- :: # fbf/plugs/common/8b.py # # t """ run the eight ball. """ .. _fbf.plugs.extra.8b_fbf_imports: fbf imports -------------- :: from fbf.utils.exception import handle_exception from fbf.lib.commands import cmnds from fbf.lib.examples import examples .. _fbf.plugs.extra.8b_basic_imports: basic imports ---------------- :: import re import random .. _fbf.plugs.extra.8b_defines_: defines ---------- :: balltxt=[ "Signs point to yes.", "Yes.", "Most likely.", "Without a doubt.", "Yes - definitely.", "As I see it, yes.", "You may rely on it.", "Outlook good.", "It is certain.", "It is decidedly so.", "Reply hazy, try again.", "Better not tell you now.", "Ask again later.", "Concentrate and ask again.", "Cannot predict now.", "My sources say no.", "Very doubtful.", "My reply is no.", "Outlook not so good.", "Don't count on it." ] .. _fbf.plugs.extra.8b_8b_command: 8b command ------------- :: def handle_8b(bot, ievent): """ no arguments - throw the eight ball. """ ievent.reply(random.choice(balltxt)) cmnds.add('8b', handle_8b, ['OPER', 'USER', 'GUEST']) examples.add('8b', 'show what the magic 8 ball has to say.', '8b')