Trait teloxide_core::payloads::SendDiceSetters
source · pub trait SendDiceSetters: HasPayload<Payload = SendDice> + Sized {
// Provided methods
fn chat_id<T>(self, value: T) -> Self
where T: Into<Recipient> { ... }
fn message_thread_id(self, value: i32) -> Self { ... }
fn emoji(self, value: DiceEmoji) -> Self { ... }
fn disable_notification(self, value: bool) -> Self { ... }
fn protect_content(self, value: bool) -> Self { ... }
fn reply_to_message_id(self, value: MessageId) -> Self { ... }
fn allow_sending_without_reply(self, value: bool) -> Self { ... }
fn reply_markup<T>(self, value: T) -> Self
where T: Into<ReplyMarkup> { ... }
}
Expand description
Setters for fields of SendDice
Provided Methods§
sourcefn message_thread_id(self, value: i32) -> Self
fn message_thread_id(self, value: i32) -> Self
Setter for message_thread_id
field.
sourcefn emoji(self, value: DiceEmoji) -> Self
fn emoji(self, value: DiceEmoji) -> Self
Setter for emoji
field.
Examples found in repository?
examples/self_info.rs (line 17)
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
async fn main() -> Result<(), Box<dyn std::error::Error>> {
pretty_env_logger::init();
let chat_id =
ChatId(std::env::var("CHAT_ID").expect("Expected CHAT_ID env var").parse::<i64>()?);
let bot = Bot::from_env().parse_mode(ParseMode::MarkdownV2);
let Me { user: me, .. } = bot.get_me().await?;
bot.send_dice(chat_id).emoji(DiceEmoji::Dice).await?;
bot.send_message(chat_id, format!("Hi, my name is **{}** 👋", me.first_name)).await?;
Ok(())
}
sourcefn disable_notification(self, value: bool) -> Self
fn disable_notification(self, value: bool) -> Self
Setter for disable_notification
field.
sourcefn protect_content(self, value: bool) -> Self
fn protect_content(self, value: bool) -> Self
Setter for protect_content
field.
sourcefn reply_to_message_id(self, value: MessageId) -> Self
fn reply_to_message_id(self, value: MessageId) -> Self
Setter for reply_to_message_id
field.
sourcefn allow_sending_without_reply(self, value: bool) -> Self
fn allow_sending_without_reply(self, value: bool) -> Self
Setter for allow_sending_without_reply
field.
sourcefn reply_markup<T>(self, value: T) -> Selfwhere
T: Into<ReplyMarkup>,
fn reply_markup<T>(self, value: T) -> Selfwhere T: Into<ReplyMarkup>,
Setter for reply_markup
field.