async def predicate(ctx: Context) -> bool: if not hasattr(ctx, "character_data"): ctx.character_data = await ctx.bot.pool.fetchrow( 'SELECT * FROM profile WHERE "user"=$1;', ctx.author.id) if ctx.character_data["god"]: return True raise NeedsGod()
async def predicate(ctx: Context) -> bool: if not hasattr(ctx, "character_data"): ctx.character_data = await ctx.bot.pool.fetchrow( 'SELECT * FROM profile WHERE "user"=$1;', ctx.author.id) if ctx.character_data["guildrank"] == "Leader": return True raise NoGuildPermissions()
async def predicate(ctx: Context) -> bool: ctx.character_data = await ctx.bot.pool.fetchrow( 'SELECT * FROM profile WHERE "user"=$1;', ctx.author.id ) if ctx.character_data["guildrank"] != "Leader": return True raise NeedsNoGuildLeader()
async def predicate(ctx: Context) -> bool: ctx.character_data = await ctx.bot.pool.fetchrow( 'SELECT * FROM profile WHERE "user"=$1;', ctx.author.id ) if ctx.character_data: return True raise NoCharacter()
async def predicate(ctx: Context) -> bool: if not hasattr(ctx, "character_data"): ctx.character_data = await ctx.bot.cache.get_profile(ctx.author.id) classes = [ c for i in ctx.character_data["class"] if (c := class_from_string(i)) ]
async def predicate(ctx: Context) -> bool: if not hasattr(ctx, "character_data"): ctx.character_data = await ctx.bot.cache.get_profile(ctx.author.id) if (ctx.character_data["guildrank"] == "Leader" or ctx.character_data["guildrank"] == "Officer"): return True raise NoGuildPermissions()
async def predicate(ctx: Context) -> bool: if not hasattr(ctx, "character_data"): ctx.character_data = await ctx.bot.pool.fetchrow( 'SELECT * FROM profile WHERE "user"=$1;', ctx.author.id) classes = [ c for i in ctx.character_data["class"] if (c := class_from_string(i)) ]
async def predicate(ctx: Context) -> bool: if not hasattr(ctx, "character_data"): ctx.character_data = await ctx.bot.cache.get_profile(ctx.author.id) if ( check := ctx.bot.in_class_line(ctx.character_data["class"], class_) ) and class_ == "Ranger": ctx.pet_data = await ctx.bot.pool.fetchrow( 'SELECT * FROM pets WHERE "user"=$1;', ctx.author.id )
async def predicate(ctx: Context) -> bool: async with ctx.bot.pool.acquire() as conn: if not hasattr(ctx, "character_data"): ctx.character_data = await conn.fetchrow( 'SELECT * FROM profile WHERE "user"=$1;', ctx.author.id) alliance = await conn.fetchval( 'SELECT alliance FROM guild WHERE "id"=$1', ctx.character_data["guild"]) owned_city = await conn.fetchval( 'SELECT name FROM city WHERE "owner"=$1', alliance) if owned_city: raise CityOwned() return True
async def predicate(ctx: Context) -> bool: async with ctx.bot.pool.acquire() as conn: if not hasattr(ctx, "character_data"): ctx.character_data = await conn.fetchrow( 'SELECT * FROM profile WHERE "user"=$1;', ctx.author.id) leading_guild = await conn.fetchval( 'SELECT alliance FROM guild WHERE "id"=$1;', ctx.character_data["guild"]) if (leading_guild == ctx.character_data["guild"] and ctx.character_data["guildrank"] == "Leader"): return True raise NoAlliancePermissions()
async def predicate(ctx: Context) -> bool: async with ctx.bot.pool.acquire() as conn: if not hasattr(ctx, "character_data"): ctx.character_data = await ctx.bot.cache.get_profile( ctx.author.id, conn=conn) alliance = await conn.fetchval( 'SELECT alliance FROM guild WHERE "id"=$1', ctx.character_data["guild"]) owned_city = await conn.fetchval( 'SELECT name FROM city WHERE "owner"=$1', alliance) if not owned_city: raise NoCityOwned() ctx.city = owned_city return True
async def predicate(ctx: Context) -> bool: if not hasattr(ctx, "character_data"): ctx.character_data = await ctx.bot.cache.get_profile(ctx.author.id) if ctx.character_data["god"]: return True raise NeedsGod()
async def predicate(ctx: Context) -> bool: if not hasattr(ctx, "character_data"): ctx.character_data = await ctx.bot.cache.get_profile(ctx.author.id) if ctx.character_data["guildrank"] != "Leader": return True raise NeedsNoGuildLeader()
async def predicate(ctx: Context) -> bool: ctx.character_data = await ctx.bot.cache.get_profile(ctx.author.id) if ctx.character_data: return True raise NoCharacter()