diff --git a/rengobot.py b/rengobot.py index 37bc5a1..65ba377 100644 --- a/rengobot.py +++ b/rengobot.py @@ -1,14 +1,14 @@ -import os import ast +import asyncio +import os import time from datetime import datetime, timedelta -import asyncio - -import sgfengine import discord from discord.ext import commands, tasks +import sgfengine + # import requests # import raw_input @@ -121,6 +121,10 @@ async def play(ctx, arg): await ctx.send("No two consecutive moves by the same player!") return + if len(state[i][2])>1 and state[i][2][-2] == user.id and (state[i][1]!="teachers" or colour=="0"): + await ctx.send("No two consecutive same-color moves by the same player!") + return + for j in range(len(state[i][2])): if (state[i][2][j] == user.id and datetime.now() - datetime.strptime(state[i][3][j],format) < min_time_player): @@ -552,4 +556,4 @@ async def background_task(): # bot.run(token) # background_task.start() -# bot.run(token) \ No newline at end of file +# bot.run(token)