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: ThreadId) -> Self { ... }
    fn emoji(self, value: DiceEmoji) -> Self { ... }
    fn disable_notification(self, value: bool) -> Self { ... }
    fn protect_content(self, value: bool) -> Self { ... }
    fn reply_parameters(self, value: ReplyParameters) -> 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) -> Self
where T: Into<Recipient>,

Setter for chat_id field.

source

fn message_thread_id(self, value: ThreadId) -> 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_parameters(self, value: ReplyParameters) -> Self

Setter for reply_parameters field.

source

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

Setter for reply_markup field.

Object Safety§

This trait is not object safe.

Implementors§

source§

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