curious.commands.context¶
Class for the commands context.
Classes
Context(message, event_context) |
A class that represents the context for a command. |
-
class
curious.commands.context.Context(message: curious.dataclasses.message.Message, event_context: curious.core.event.EventContext)[source]¶ Bases:
objectA class that represents the context for a command.
Parameters: - message (
Message) – TheMessagethis command was invoked with. - event_context (
EventContext) – The EventContext for this context.
-
message= None¶ The message for this context.
-
command_name= None¶ The extracted command name for this context.
-
tokens= None¶ The tokens for this context.
-
formatted_command= None¶ The formatted command for this context.
-
plugin= None¶ The plugin for this context.
-
manager= None¶ The manager for this context.
-
event_context= None¶ The event context for this context.
-
classmethod
add_converter(converter)[source]¶ Adds a converter to the mapping of converters.
Parameters:
-
_lookup_converter(annotation)[source]¶ Looks up a converter for the specified annotation.
Return type: Callable[[Any,Context,str],Any]
-
await
_get_converted_args(func)[source]¶ Gets the converted args and kwargs for this command, based on the tokens.
Return type: Tuple[tuple,dict]
-
_make_reraise_ctx(new_name)[source]¶ Makes a new
EventContextfor re-dispatching.Return type: EventContext
-
await
can_run(cmd)[source]¶ Checks if a command can be ran.
Return type: Tuple[bool,list]Returns: If it can be ran, and a list of conditions that failed.
- message (