twilight_util/builder/message/
checkbox.rs1use twilight_model::channel::message::component::Checkbox;
2
3#[derive(Clone, Debug, Eq, PartialEq)]
5#[must_use = "must be built into a checkbox"]
6pub struct CheckboxBuilder(Checkbox);
7impl CheckboxBuilder {
8 pub fn new(custom_id: impl Into<String>) -> Self {
10 Self(Checkbox {
11 id: None,
12 custom_id: custom_id.into(),
13 default: None,
14 })
15 }
16
17 pub const fn id(mut self, id: i32) -> Self {
19 self.0.id.replace(id);
20
21 self
22 }
23
24 pub const fn default(mut self, default: bool) -> Self {
26 self.0.default.replace(default);
27
28 self
29 }
30
31 pub fn build(self) -> Checkbox {
33 self.0
34 }
35}