mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-22 14:35:36 +01:00
Merge pull request #246 from teloxide/remove_inline_query_methods
Remove methods for creating `InlineQuery`
This commit is contained in:
commit
40e9a13d22
2 changed files with 6 additions and 55 deletions
|
@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
|
||||
## unreleased
|
||||
|
||||
### Removed
|
||||
|
||||
- Methods for creating `InlineQuery` ([#246][pr244])
|
||||
|
||||
[pr244]: https://github.com/teloxide/teloxide-core/pull/246
|
||||
|
||||
## 0.7.1 - 2022-08-19
|
||||
|
||||
### Fixed
|
||||
|
|
|
@ -33,58 +33,3 @@ pub struct InlineQuery {
|
|||
/// from a secret chat.
|
||||
pub chat_type: Option<ChatType>,
|
||||
}
|
||||
|
||||
// TODO(waffle): remove
|
||||
impl InlineQuery {
|
||||
pub fn new<S1, S2, S3>(id: S1, from: User, query: S2, offset: S3) -> Self
|
||||
where
|
||||
S1: Into<String>,
|
||||
S2: Into<String>,
|
||||
S3: Into<String>,
|
||||
{
|
||||
Self {
|
||||
id: id.into(),
|
||||
from,
|
||||
location: None,
|
||||
query: query.into(),
|
||||
offset: offset.into(),
|
||||
chat_type: None,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn id<S>(mut self, val: S) -> Self
|
||||
where
|
||||
S: Into<String>,
|
||||
{
|
||||
self.id = val.into();
|
||||
self
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn from(mut self, val: User) -> Self {
|
||||
self.from = val;
|
||||
self
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn location(mut self, val: Location) -> Self {
|
||||
self.location = Some(val);
|
||||
self
|
||||
}
|
||||
|
||||
pub fn query<S>(mut self, val: S) -> Self
|
||||
where
|
||||
S: Into<String>,
|
||||
{
|
||||
self.query = val.into();
|
||||
self
|
||||
}
|
||||
|
||||
pub fn offset<S>(mut self, val: S) -> Self
|
||||
where
|
||||
S: Into<String>,
|
||||
{
|
||||
self.offset = val.into();
|
||||
self
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue