up
This commit is contained in:
parent
768274f547
commit
ab8b138e0c
@ -36,6 +36,11 @@ black_stone= "<:black_stone:882730888453046342>"
|
|||||||
with open("token.txt") as f:
|
with open("token.txt") as f:
|
||||||
token = f.readlines()[0] # Get your own token and put it in token.txt
|
token = f.readlines()[0] # Get your own token and put it in token.txt
|
||||||
|
|
||||||
|
|
||||||
|
if not os.path.exists("state.txt"):
|
||||||
|
with open("state.txt", "w") as f:
|
||||||
|
f.write("[]")
|
||||||
|
|
||||||
format="%Y_%m_%d_%H_%M_%S_%f"
|
format="%Y_%m_%d_%H_%M_%S_%f"
|
||||||
|
|
||||||
# The state is a list of tuples (channel_id, "queue"/"random", last_players, last_times, [black_queue, white_queue])
|
# The state is a list of tuples (channel_id, "queue"/"random", last_players, last_times, [black_queue, white_queue])
|
||||||
@ -397,7 +402,7 @@ async def newgame(ctx, gametype, handicap=0, komi=6.5):
|
|||||||
|
|
||||||
# lowest effort serialization
|
# lowest effort serialization
|
||||||
with open("state.txt") as f:
|
with open("state.txt") as f:
|
||||||
state = eval(f.read())
|
state = ast.literal_eval(f.read())
|
||||||
|
|
||||||
|
|
||||||
if channel_id in [ ch for (ch,_,_,_,_) in state]:
|
if channel_id in [ ch for (ch,_,_,_,_) in state]:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user