async def skip_if_started_or_wait_if_starting(self, ctx): if self.is_started(): return Skip() if self.is_starting() or self.is_restarting_starting(): await self._started_event.wait() return Skip() return Success()
def two(self, ctx): if ctx.foo > 1: return Failure() if ctx.bar < 0: return Skip() return Success(baz=4)
def two(self, ctx): if ctx.foo > 2: return Failure("'foo' is too big") if ctx.foo > 1: return Failure() if ctx.bar < 0: return Skip() return Success(baz=4)
async def before(self, ctx): return Skip()
def test_skip_representation(): skip = Skip() assert repr(skip) == "Skip()"
def first(self, ctx): return Skip()
async def skip_if_not_initializing(self, ctx): return Success() if self.is_initializing() else Skip()
def check_that_it_is_my_message(self, ctx): if ctx.message["content"] == f"@**{self._bot_name}**": return Success() else: return Skip()