-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathtarot.py
76 lines (64 loc) · 1.88 KB
/
tarot.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/usr/bin/env python3
# coding=utf-8
# Tarot Module for drastikbot
#
# Draws three cards from the tarot deck.
# Usage: .tarot
'''
Copyright (C) 2018 Newt Vodyanoy
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
'''
import random
class Module:
bot_commands = ['tarot']
manual = {
"desc": "Draws three cards from the tarot deck.",
"bot_commands": {"tarot": {"usage": lambda x: f"{x}tarot"}}
}
major_arcana = [
"The Fool",
"The Magician",
"The High Priestess",
"The Empress",
"The Emperor",
"The Hierophant",
"The Lovers",
"The Chariot",
"Strength",
"The Hermit",
"Wheel of Fortune",
"Justice",
"The Hanged Man",
"Death",
"Temperance",
"Devil",
"The Tower",
"The Star",
"The Moon",
"The Sun",
"Judgement",
"The World"
]
suits = ["Swords", "Wands", "Coins", "Cups"]
suit_cards = [
"Ace", "Two", "Three", "Four", "Five", "Six", "Seven",
"Eight", "Nine", "Ten", "Page", "Knight", "Queen", "King"
]
minor_arcana = list()
for card in ((x, y) for x in suit_cards for y in suits):
minor_arcana.append("The %s of %s" % card)
deck = major_arcana + minor_arcana
def main(i, irc):
cards = random.sample(deck, 3)
irc.out.notice(
i.msg.get_msgtarget(),
f'{i.msg.get_nickname()}: {cards[0]}, {cards[1]}, {cards[2]}')