1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct BotCommand {
pub command: String,
pub description: String,
}
impl BotCommand {
pub fn new<S1, S2>(command: S1, description: S2) -> Self
where
S1: Into<String>,
S2: Into<String>,
{
Self { command: command.into(), description: description.into() }
}
pub fn command<S>(mut self, val: S) -> Self
where
S: Into<String>,
{
self.command = val.into();
self
}
pub fn description<S>(mut self, val: S) -> Self
where
S: Into<String>,
{
self.description = val.into();
self
}
}