Skip to content

Instantly share code, notes, and snippets.

@brantje
Created September 6, 2013 11:44
Show Gist options
  • Save brantje/6462726 to your computer and use it in GitHub Desktop.
Save brantje/6462726 to your computer and use it in GitHub Desktop.
Magic 8Ball for willie
"""
forum.py - Show a link to the xbian forum
Copyright 2013, Edward Powell - embolalia.net
Licensed under the Eiffel Forum License 2.
http://willie.dfbta.net
"""
import willie
import random
@willie.module.commands('8')
def ball(bot, trigger):
"""Ask the magic 8ball a question! Usage: !8 <question>"""
messages = ["It is certain"," It is decidedly so","Without a doubt","Yes definitely","You may rely on it","As I see it yes","Most likely","Outlook good","Yes","Signs point to yes","Reply hazy try again","Ask again later","Better not tell you now","Cannot predict now","Concentrate and ask again","Don't count on it","My reply is no","God says no","Very doubtful","Outlook not so good"]
answer = random.randint(0,len(messages))
bot.say(messages[answer]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment