discord-interactions.py

timing_middleware

Function

Reports commands slower than a threshold.

from discord_interactions.slash import timing_middleware

Signature

def timing_middleware(    *,    slow_threshold_ms: float = 3000,    on_slow: Callable[[SlashContext, float], Awaitable[None]] | None = None,) -> Middleware

Parameters

NameTypeDefaultDescription
slow_threshold_msfloat3000
on_slowCallable[[SlashContext, float], Awaitable[None]] | NoneNone

Returns

Middleware

Type a name: create_button, ModalBuilder, cooldown.