dibug package
Subpackages
Submodules
dibug.dibugger module
- class dibug.dibugger.Dibugger(client: Client, user_has_perm: Callable[[Message], Coroutine[Any, Any, bool]], no_perm: Callable[[Message], Coroutine[Any, Any, None]], prefix: str = '!dbg', patch_on_init: bool = True)[source]
Bases:
object
A debugger for discord.py bots.
Parameters
- clientClient
The discord.py client to attach the debugger to.
- user_has_permCallable[[Message], Coroutine[Any, Any, bool]]
A function that returns whether the user has permission to use the debugger.
- no_permCallable[[Message], Coroutine[Any, Any, None]]
A function that is called when the user doesn’t have permission.
- prefixstr, optional
The prefix for the debugger, by default “!dbg”.
- patch_on_initbool, optional
Whether to patch the client on init, by default True. If False, you will have to manually call
handle_msg()
on every message, and every edited message if you want.
Methods
- handle_msg(msg: Message)
Handle a message and execute the command if it exists.
Class Methods
- attach(
client: Client, user_has_perm: Callable[[Message], Coroutine[Any, Any, bool]], no_perm: Callable[[Message], Coroutine[Any, Any, None]], prefix: str = “!dbg”, patch_on_init: bool = True,
- ) -> Dibugger
Attach a debugger to a discord.py client.
- classmethod attach(client: Client, user_has_perm: Callable[[Message], Coroutine[Any, Any, bool]], no_perm: Callable[[Message], Coroutine[Any, Any, None]], prefix: str = '!dbg', patch_on_init: bool = True) Dibugger [source]
Attach a debugger to a discord.py client.
Parameters
- clientClient
The discord.py client to attach the debugger to.
- user_has_permCallable[[Message], Coroutine[Any, Any, bool]]
A function that returns whether the user has permission to use the debugger.
- no_permCallable[[Message], Coroutine[Any, Any, None]]
A function that is called when the user doesn’t have permission.
- prefixstr, optional
The prefix for the debugger, by default “!dbg”.
- patch_on_initbool, optional
Whether to patch the client on init, by default True. If False, you will have to manually call
handle_msg()
on every message, and every edited message if you want.
Returns
- Dibugger
The debugger that was attached.