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§

source

fn chat_id<T>(self, value: T) -> Selfwhere T: Into<Recipient>,

Setter for chat_id field.

source

fn message_thread_id(self, value: i32) -> Self

Setter for message_thread_id field.

source

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(())
}
source

fn disable_notification(self, value: bool) -> Self

Setter for disable_notification field.

source

fn protect_content(self, value: bool) -> Self

Setter for protect_content field.

source

fn reply_to_message_id(self, value: MessageId) -> Self

Setter for reply_to_message_id field.

source

fn allow_sending_without_reply(self, value: bool) -> Self

Setter for allow_sending_without_reply field.

source

fn reply_markup<T>(self, value: T) -> Selfwhere T: Into<ReplyMarkup>,

Setter for reply_markup field.

Implementors§

source§

impl<P> SendDiceSetters for Pwhere P: HasPayload<Payload = SendDice>,