#Detect whether CommandError is caused by a check

1 messages · Page 1 of 1 (latest)

wild echo
#

Hello,
I made this check:


self.add_ext_check(self.heurecheck)
…
async def heurecheck(context: BaseContext):
        now = datetime.now()
        print(now.hour)
        if now.hour >=22 or now.hour <=7:
            print('returning false')
            return False
        return True

but I'd like it to return another custom Embed if it's about this particular check.

Do you know how to check whether this is the case?

rancid iglooBOT
#

Hey! Once your issue is solved, press the button below to close this thread!

wild echo
#

Detect whether CommandError is caused by a check

winged niche
#

You could try to send the embed before returning false