mirror of
https://github.com/NCBM/plyngent.git
synced 2026-07-23 05:55:16 +08:00
ci/typecheck: clear slash.py basedpyright warnings
Raise BadParameter instead of fail()+return; drop unnecessary pyright ignore.
This commit is contained in:
@@ -56,8 +56,8 @@ class OnOffParam(click.ParamType[bool]):
|
|||||||
return True
|
return True
|
||||||
if token in {"off", "0", "false", "no"}:
|
if token in {"off", "0", "false", "no"}:
|
||||||
return False
|
return False
|
||||||
self.fail("expected on or off", param, ctx)
|
msg = "expected on or off"
|
||||||
return False
|
raise click.BadParameter(msg, ctx=ctx, param=param)
|
||||||
|
|
||||||
|
|
||||||
ON_OFF = OnOffParam()
|
ON_OFF = OnOffParam()
|
||||||
@@ -95,7 +95,7 @@ def slash_command_names() -> list[str]:
|
|||||||
|
|
||||||
def _await[T](awaitable: Awaitable[T]) -> T:
|
def _await[T](awaitable: Awaitable[T]) -> T:
|
||||||
# Greenlet parks until the awaitable completes on the running loop.
|
# Greenlet parks until the awaitable completes on the running loop.
|
||||||
return awaitlet.awaitlet(awaitable) # pyright: ignore[reportUnknownVariableType]
|
return awaitlet.awaitlet(awaitable)
|
||||||
|
|
||||||
|
|
||||||
# --- commands -----------------------------------------------------------------
|
# --- commands -----------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user