v6d3music/v6d3music/utils/catch.py
2022-06-19 20:41:11 +03:00

11 lines
349 B
Python

from typing import Iterable
from v6d2ctx.context import Context, Implicit
async def catch(ctx: Context, args: list[str], reply: str, *catched: (Iterable[str] | str)):
catched = {(case,) if isinstance(case, str) else tuple(case) for case in catched}
if tuple(args) in catched:
await ctx.reply(reply.strip())
raise Implicit