Struct twilight_util::builder::CallbackDataBuilder [−][src]
pub struct CallbackDataBuilder(_);This is supported on crate feature
builder only.Expand description
Create a CallbackData with a builder.
Example
use twilight_util::builder::CallbackDataBuilder;
use twilight_model::{
channel::message::MessageFlags,
application::component::{button::ButtonStyle, Component, Button}
};
let component = Component::Button(Button {
style: ButtonStyle::Primary,
emoji: None,
label: Some("Button label".to_string()),
custom_id: Some("button_id".to_string()),
url: None,
disabled: false,
});
let callback_data = CallbackDataBuilder::new()
.content("Callback message".to_string())
.flags(MessageFlags::EPHEMERAL)
.components([component.clone()])
.build();
assert_eq!(callback_data.components, Some(vec![component]));Implementations
Create a new builder to construct a CallbackData.
Consume the builder, returning a CallbackData.
Set the AllowedMentions of the callback.
Defaults to None.
Set the message content of the callback.
Defaults to None.
Set the Embeds of the callback.
Defaults to an empty list.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for CallbackDataBuilder
impl Send for CallbackDataBuilder
impl Sync for CallbackDataBuilder
impl Unpin for CallbackDataBuilder
impl UnwindSafe for CallbackDataBuilder
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more