Skip to content

Validation layer

Babouche edited this page May 26, 2025 · 1 revision

To ensure consistency, all interaction with the end-user must be checked. Too bad for us, this is not like an API with pydantic where we can receive an object already checked with the correct format. The discord library that we use only provide us a message.

How to get arguments

In order to get your arguments we must, first, get the user message without the command name. For this, you can use the method Utility.get_content_without_command() in order to get back a string without the command.

message: str = context.message # context is from the discord.py
content: str = Utility.get_content_without_command(message.content)

WIP

Clone this wiki locally