seven_client/status.rs
1use crate::client::Client;
2use ureq::{Error};
3
4pub struct StatusParams {
5 pub msg_id: u64
6}
7
8pub struct Status {
9 client: Client
10}
11
12impl Status {
13 pub fn new(client: Client) -> Self {
14 Status {
15 client,
16 }
17 }
18
19 pub fn text(&self, params: StatusParams) -> Result<String, Error> {
20 Ok(self.client.request("GET", "status")
21 .query("msg_id", &*params.msg_id.to_string())
22 .call()?
23 .into_string()?)
24 }
25}