-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdraw.py
More file actions
70 lines (63 loc) · 2.03 KB
/
Copy pathdraw.py
File metadata and controls
70 lines (63 loc) · 2.03 KB
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
# tarotBot.py
import os
import sys
import random
import asyncio
import shelve
import discord
from datetime import datetime
from dotenv import load_dotenv
from randomCard import *
from peace import *
from test import *
from defs import *
from draw import *
from switchDeck import *
async def draw(message, meaningsChosen, v, userN, client):
meanings2 = meaningsChosen[0]
broken = False
choice1 = random.choice(list(meanings2.items()))
choice2 = random.choice(list(meanings2.items()))
choice3 = random.choice(list(meanings2.items()))
button = await message.channel.send("Select 1, 2, or 3")
mess = await message.channel.send(file=discord.File('card back purple 3.png'))
# msg = await client.wait_for('message', timeout=30)
# msg = msg.content
# if msg == "1":
# card = meanings[choice1[0]]
# elif msg == "2":
# card = meanings[choice2[0]]
# elif msg == "3":
# card = meanings[choice3[0]]
# else:
# await message.channel.send('I didn\'t get that :( ')
e1 = "1️⃣"
e2 = "2️⃣"
e3 = "3️⃣"
await mess.add_reaction(e1)
await mess.add_reaction(e2)
await mess.add_reaction(e3)
def check(reaction, user):
return user != mess.author and (user == userN) and reaction.message.id == mess.id
try:
reaction, user = await client.wait_for('reaction_add', timeout=60.0, check=check)
except asyncio.TimeoutError:
print("timed out")
await message.channel.send("You forgot about me :(")
broken = True
else:
if reaction.emoji == e1:
card = meanings2[choice1[0]]
elif reaction.emoji == e2:
card = meanings2[choice2[0]]
elif reaction.emoji == e3:
card = meanings2[choice3[0]]
if v == False:
await message.channel.send("You drew *"+card.name+"*")
broken = True
if broken == False:
await dispCard(message, meaningsChosen, client, card, False)
await button.delete()
await mess.delete()
broken = True
return(card)