示例#1
0
    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()
示例#2
0
    def two(self, ctx):
        if ctx.foo > 1:
            return Failure()

        if ctx.bar < 0:
            return Skip()

        return Success(baz=4)
示例#3
0
    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)
示例#4
0
 async def before(self, ctx):
     return Skip()
示例#5
0
def test_skip_representation():

    skip = Skip()
    assert repr(skip) == "Skip()"
示例#6
0
 def first(self, ctx):
     return Skip()
示例#7
0
 async def skip_if_not_initializing(self, ctx):
     return Success() if self.is_initializing() else Skip()
示例#8
0
 def check_that_it_is_my_message(self, ctx):
     if ctx.message["content"] == f"@**{self._bot_name}**":
         return Success()
     else:
         return Skip()