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