You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Fox-V3/werewolf/builder.py

52 lines
1.2 KiB

import discord
# Import all roles here
from werewolf.roles.seer import Seer
from werewolf.roles.vanillawerewolf import VanillaWerewolf
from werewolf.roles.villager import Villager
# All roles in this list for iterating
7 years ago
role_list = [Villager, VanillaWerewolf]
"""
Example code:
0 = Villager
1 = VanillaWerewolf
E1 = Random Town
R1 = Random Werewolf
J1 = Benign Neutral
0001-1112E11R112P2
0,0,0,1,11,12,E1,R1,R1,R1,R2,P2
pre-letter = exact role position
double digit position preempted by `-`
"""
async def parse_code(code):
"""Do the magic described above"""
out = []
7 years ago
decode = code.copy() # for now, pass exact names
for role_id in decode:
7 years ago
print(role_id)
if role_id == "Villager":
role = Villager
elif role_id == "VanillaWerewolf":
role = VanillaWerewolf
elif role_id == "Seer":
role = Seer
else: # Fail to parse
return None
out.append(role)
7 years ago
return out
async def build_game(channel: discord.TextChannel):
await channel.send("Not currently available")
7 years ago
code = 12345678
7 years ago
await channel.send("Your game code is **`{}`**".format(code))
# Make this embeds