Esempio n. 1
0
 def predicate(ctx: commands.Context) -> bool:
     """Check the user is logged in."""
     ctx.session_model = models.Session.get_by_ctx(ctx)
     if not ctx.session_model:
         return False
     ctx.session = ctx.session_model.get_session(ctx.bot.client)
     return True
Esempio n. 2
0
 async def before_invoke_hook(self, ctx: commands.Context):
     ctx.session = self.sessionmaker()