feat: add discoverability and analytics flags (#130)

This commit is contained in:
Paul Makles
2022-01-03 13:12:13 +00:00
committed by GitHub
parent 03ca611553
commit 139e704746
10 changed files with 36 additions and 10 deletions

View File

@@ -1,5 +1,9 @@
use serde::{Serialize, Deserialize};
pub fn if_false(t: &bool) -> bool {
!t
}
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct Bot {
#[serde(rename = "_id")]
@@ -7,6 +11,10 @@ pub struct Bot {
pub owner: String,
pub token: String,
pub public: bool,
#[serde(skip_serializing_if = "if_false", default)]
pub analytics: bool,
#[serde(skip_serializing_if = "if_false", default)]
pub discoverable: bool,
#[serde(skip_serializing_if = "Option::is_none")]
pub interactions_url: Option<String>,
}