Esempio n. 1
0
    async def action_igdb_query(self,
                                context: Context,
                                query: str,
                                endpoint: str = 'games',
                                success=None,
                                fail=None):
        if not query:
            await execute_action(context, fail)
            return

        query = context.render_template(query)
        results = await self.query(endpoint=endpoint, query=query)

        if not results:
            await execute_action(context, fail)
            return

        context.local['results'] = results
        await execute_action(context, success)
Esempio n. 2
0
 async def _fn(ctx: Context):
     return bool(ctx.render_template(condition))
Esempio n. 3
0
 async def _fn(ctx: Context):
     print(ctx.render_template(value))
     return True
Esempio n. 4
0
 async def _fn(ctx: Context):
     ctx.local[var] = ctx.render_template(value)
     return True
Esempio n. 5
0
 def evaluate(self, context: Context) -> str:
     return context.render_template(self.template,
                                    resolve_emoji=self.resolve_emoji)