test: add tests to bot routes
This commit is contained in:
@@ -80,10 +80,16 @@ auto_derived!(
|
||||
/// Bot Username
|
||||
pub username: String,
|
||||
/// Profile Avatar
|
||||
#[cfg_attr(feature = "serde", serde(skip_serializing_if = "String::is_empty"))]
|
||||
#[cfg_attr(
|
||||
feature = "serde",
|
||||
serde(skip_serializing_if = "String::is_empty", default)
|
||||
)]
|
||||
pub avatar: String,
|
||||
/// Profile Description
|
||||
#[cfg_attr(feature = "serde", serde(skip_serializing_if = "String::is_empty"))]
|
||||
#[cfg_attr(
|
||||
feature = "serde",
|
||||
serde(skip_serializing_if = "String::is_empty", default)
|
||||
)]
|
||||
pub description: String,
|
||||
}
|
||||
|
||||
@@ -96,6 +102,7 @@ auto_derived!(
|
||||
}
|
||||
|
||||
/// Bot Details
|
||||
#[derive(Default)]
|
||||
#[cfg_attr(feature = "validator", derive(Validate))]
|
||||
pub struct DataCreateBot {
|
||||
/// Bot username
|
||||
@@ -107,6 +114,7 @@ auto_derived!(
|
||||
}
|
||||
|
||||
/// New Bot Details
|
||||
#[derive(Default)]
|
||||
#[cfg_attr(feature = "validator", derive(Validate))]
|
||||
pub struct DataEditBot {
|
||||
/// Bot username
|
||||
@@ -130,6 +138,21 @@ auto_derived!(
|
||||
pub remove: Option<Vec<FieldsBot>>,
|
||||
}
|
||||
|
||||
/// Where we are inviting a bot to
|
||||
#[serde(untagged)]
|
||||
pub enum InviteBotDestination {
|
||||
/// Invite to a server
|
||||
Server {
|
||||
/// Server Id
|
||||
server: String,
|
||||
},
|
||||
/// Invite to a group
|
||||
Group {
|
||||
/// Group Id
|
||||
group: String,
|
||||
},
|
||||
}
|
||||
|
||||
/// Owned Bots Response
|
||||
///
|
||||
/// Both lists are sorted by their IDs.
|
||||
|
||||
Reference in New Issue
Block a user