vaegram 0.2.0

Telegram MTProto client library for users and bots
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::Client;
use crate::errors::Result;
use crate::methods::accepted;
use crate::raw::functions;
use crate::types::BusinessOpeningHours;

impl Client {
    /// Sets the business account's opening hours.
    ///
    /// Fails with `Error::InvalidArgument` if `hours` has no time zone, or an interval that is empty, starts
    /// outside the week, lasts more than a week or ends more than 8 days after Monday 00:00.
    pub async fn set_business_opening_hours(&self, hours: &BusinessOpeningHours) -> Result<()> {
        let business_work_hours = Some(hours.write()?);
        accepted(self.invoke(&functions::account::UpdateBusinessWorkHours { business_work_hours }).await?)
    }
}