-
Notifications
You must be signed in to change notification settings - Fork 4
/
8ball.py
45 lines (40 loc) · 1.01 KB
/
8ball.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
"""
8ball.py - Ask the magic 8ball a question
Licensed under the Eiffel Forum License 2.
"""
import sopel
import random
messages = [
"Most definitely yes",
"For sure",
"As I see it, yes",
"My sources say yes",
"Yes",
"Most likely",
"Perhaps",
"Maybe",
"Not sure",
"It is uncertain",
"Ask me again later",
"Don't count on it",
"Probably not",
"Very doubtful",
"Most likely no",
"Nope",
"No",
"My sources say no",
"Dont even think about it",
"Definitely no",
"NO - It may cause disease contraction"
]
@sopel.module.commands('8', '8ball')
def eight_ball(bot, trigger):
"""
Ask the magic 8ball a question! Usage: .8 <question>
"""
if not trigger.group(2):
return bot.say('A whispered "No" can be heard in the distance')
# Seed it to the nick and message so users will get consistent answers
random.seed(trigger.nick + trigger.group(2))
answer = random.randint(0,len(messages) - 1)
bot.say(messages[answer]);