async def predicate(ctx: commands.Context): scrim = await Scrim.get_scrim(ctx) if not scrim.state == ScrimState.INACTIVE: raise BotCheckFailure( "There is already an active scrim on the channel.") ctx.scrim = scrim return True
async def predicate(ctx: commands.Context): scrim = await Scrim.get_scrim(ctx) if ctx.author != scrim.master: raise BotCheckFailure("Only the scrim creator can do that.") elif scrim.state == ScrimState.INACTIVE: raise BotCheckFailure( "That command requires an active scrim on the channel.") ctx.scrim = scrim return True