Add documentation for the PrefixGetter trait
This commit is contained in:
@@ -27,8 +27,23 @@ pub enum RuntimeError {
|
||||
ApplicationFetchingFailed,
|
||||
}
|
||||
|
||||
/// Getter trait for command prefixes.
|
||||
#[async_trait]
|
||||
pub trait PrefixGetter<T> {
|
||||
/// Get the command prefixes for the given server and user IDs.
|
||||
///
|
||||
/// The getter must never fail. In case an internal process does, it must fall back to default
|
||||
/// prefixes.
|
||||
///
|
||||
/// Arguments:
|
||||
/// * `runtime` - The application [`Runtime`].
|
||||
/// * `server_id` - The server ID in which the command, interaction, or event is running.
|
||||
/// * `user_id` - The user ID who triggered the command, interaction, or event.
|
||||
///
|
||||
/// Returns:
|
||||
/// [`Vec<String>`] - A list of command prefixes. When matching for commands, all these
|
||||
/// prefixes should be checked against, as they're all valid. In case one should be picked, the
|
||||
/// first one will always be the safest choice.
|
||||
async fn get(
|
||||
&self,
|
||||
runtime: &Runtime<T>,
|
||||
|
||||
Reference in New Issue
Block a user