commands.auth module

Provides a proxy for authorization checks for client and say commands.

class commands.auth._AuthCallback(callback, permission=None, fail_callback=None)[source]

Bases: object

Command Authorization callback hook class.

__init__(callback, permission=None, fail_callback=None)[source]

Store all the given arguments.

  • callback (callable) – A callback to call if no permission is required or the player is authorized.
  • permissions (str) – A permission the player needs to execute the callback. If None, no permission is required.
  • fail_callback (callable) – A callback that gets called if the player is not authorized to execute the callback.