1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
use std::{
future::{Future, IntoFuture},
pin::Pin,
};
use serde::Serialize;
use crate::{api::API, errors::ConogramError, impl_into_future, request::RequestT};
#[derive(Debug, Clone, Serialize)]
pub struct CloseParams {}
impl_into_future!(CloseRequest<'a>);
///Use this method to close the bot instance before moving it from one local server to another. You need to delete the webhook before calling this method to ensure that the bot isn't launched again after server restart. The method will return error 429 in the first 10 minutes after the bot is launched. Returns *True* on success. Requires no parameters.
#[derive(Clone)]
pub struct CloseRequest<'a> {
api: &'a API,
params: CloseParams,
}
impl<'a> RequestT for CloseRequest<'a> {
type ParamsType = CloseParams;
type ReturnType = bool;
fn get_name() -> &'static str {
"close"
}
fn get_api_ref(&self) -> &API {
self.api
}
fn get_params_ref(&self) -> &Self::ParamsType {
&self.params
}
fn is_multipart() -> bool {
false
}
}
impl<'a> CloseRequest<'a> {
pub const fn new(api: &'a API) -> Self {
Self {
api,
params: CloseParams {},
}
}
}
impl API {
///Use this method to close the bot instance before moving it from one local server to another. You need to delete the webhook before calling this method to ensure that the bot isn't launched again after server restart. The method will return error 429 in the first 10 minutes after the bot is launched. Returns *True* on success. Requires no parameters.
pub const fn close(&self) -> CloseRequest {
CloseRequest::new(self)
}
}
// Divider: all content below this line will be preserved after code regen