PyDrocsid.command ¶
add_reactions
async
¶
add_reactions(ctx: Context[Any] | Message, *emojis: str) -> None
Add reactions to a given message.
Parameters:
Source code in PyDrocsid/command.py
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 |
|
can_run_command
async
¶
can_run_command(command: Command[Cog, Any, Any], ctx: Context[Bot]) -> bool
Return whether a command can be executed in a given context.
Source code in PyDrocsid/command.py
103 104 105 106 107 108 109 |
|
docs ¶
docs(text: str) -> Callable[[Func], Func]
Decorator for setting the docstring of a function.
Source code in PyDrocsid/command.py
60 61 62 63 64 65 66 67 |
|
get_optional_permissions ¶
get_optional_permissions(command: Command[Cog, Any, Any]) -> list[BasePermission]
Get the optional permissions of a given command, set by the optional_permissions decorator.
Source code in PyDrocsid/command.py
80 81 82 83 |
|
make_error ¶
make_error(message: str, user: User | Member | None = None) -> Embed
Create an error embed with an optional author.
Parameters:
Returns:
-
Embed
–the error embed
Source code in PyDrocsid/command.py
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
|
optional_permissions ¶
optional_permissions(*permissions: BasePermission) -> Callable[[Func], Func]
Decorator for setting optional permissions of a command.
Source code in PyDrocsid/command.py
70 71 72 73 74 75 76 77 |
|
reply
async
¶
reply(ctx: Message | Messageable | InteractionResponse, *args: Any, no_reply: bool = False, **kwargs: Any) -> Message
Reply to a message and link response to this message.
Parameters:
-
ctx
(
Message | Messageable | InteractionResponse
) –the context/message/messageable to reply to
-
args
–
positional arguments to pass to ctx.send/ctx.reply
-
no_reply
(
bool
) –whether to use ctx.send instead of ctx.reply
-
kwargs
–
keyword arguments to pass to ctx.send/ctx.reply
Returns:
-
Message
–the message that was sent
Source code in PyDrocsid/command.py
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 |
|