deleted IDE files

This commit is contained in:
p0lunin 2020-02-01 21:42:25 +02:00
parent 8b90581927
commit b0b9ad6204
3 changed files with 0 additions and 251 deletions

View file

@ -1,118 +0,0 @@
use crate::{
network,
requests::form_builder::FormBuilder,
types::{InputFile, MaskPosition, True},
Bot,
};
use crate::requests::{Request, ResponseResult};
/// Use this method to add a new sticker to a set created by the bot.
///
/// [The official docs](https://core.telegram.org/bots/api#addstickertoset).
#[derive(Copy, Eq, PartialEq, Debug, Clone)]
pub struct AddStickerToSet<'a> {
bot: &'a Bot,
user_id: i32,
name: String,
png_sticker: InputFile,
emojis: String,
mask_position: Option<MaskPosition>,
}
#[async_trait::async_trait]
impl Request for AddStickerToSet<'_> {
type Output = True;
async fn send(&self) -> ResponseResult<True> {
network::request_multipart(
self.bot.client(),
self.bot.token(),
"addStickerToSet",
FormBuilder::new()
.add("user_id", &self.user_id)
.await
.add("name", &self.name)
.await
.add("png_sticker", &self.png_sticker)
.await
.add("emojis", &self.emojis)
.await
.add("mask_position", &self.mask_position)
.await
.build(),
)
.await
}
}
impl<'a> AddStickerToSet<'a> {
pub(crate) fn new<N, E>(
bot: &'a Bot,
user_id: i32,
name: N,
png_sticker: InputFile,
emojis: E,
) -> Self
where
N: Into<String>,
E: Into<String>,
{
Self {
bot: BotWrapper(bot),
user_id,
name: name.into(),
png_sticker,
emojis: emojis.into(),
mask_position: None,
}
}
/// User identifier of sticker set owner.
pub fn user_id(mut self, val: i32) -> Self {
self.user_id = val;
self
}
/// Sticker set name.
pub fn name<T>(mut self, val: T) -> Self
where
T: Into<String>,
{
self.name = val.into();
self
}
/// **Png** image with the sticker, must be up to 512 kilobytes in size,
/// dimensions must not exceed 512px, and either width or height must be
/// exactly 512px.
///
/// Pass [`InputFile::File`] to send a file that exists on
/// the Telegram servers (recommended), pass an [`InputFile::Url`] for
/// Telegram to get a .webp file from the Internet, or upload a new one
/// using [`InputFile::FileId`]. [More info on Sending Files »].
///
/// [`InputFile::File`]: crate::types::InputFile::File
/// [`InputFile::Url`]: crate::types::InputFile::Url
/// [`InputFile::FileId`]: crate::types::InputFile::FileId
pub fn png_sticker(mut self, val: InputFile) -> Self {
self.png_sticker = val;
self
}
/// One or more emoji corresponding to the sticker.
pub fn emojis<T>(mut self, val: T) -> Self
where
T: Into<String>,
{
self.emojis = val.into();
self
}
/// A JSON-serialized object for position where the mask should be placed on
/// faces.
pub fn mask_position(mut self, val: MaskPosition) -> Self {
self.mask_position = Some(val);
self
}
}

View file

@ -1,118 +0,0 @@
use crate::{
network,
requests::form_builder::FormBuilder,
types::{InputFile, MaskPosition, True},
Bot,
};
use crate::requests::{Request, ResponseResult};
/// Use this method to add a new sticker to a set created by the bot.
///
/// [The official docs](https://core.telegram.org/bots/api#addstickertoset).
#[derive(Copy, Eq, PartialEq, Debug, Clone)]
pub struct AddStickerToSet<'a> {
bot: &'a Bot,
user_id: i32,
name: String,
png_sticker: InputFile,
emojis: String,
mask_position: Option<MaskPosition>,
}
#[async_trait::async_trait]
impl Request for AddStickerToSet<'_> {
type Output = True;
async fn send(&self) -> ResponseResult<True> {
network::request_multipart(
self.bot.client(),
self.bot.token(),
"addStickerToSet",
FormBuilder::new()
.add("user_id", &self.user_id)
.await
.add("name", &self.name)
.await
.add("png_sticker", &self.png_sticker)
.await
.add("emojis", &self.emojis)
.await
.add("mask_position", &self.mask_position)
.await
.build(),
)
.await
}
}
impl<'a> AddStickerToSet<'a> {
pub(crate) fn new<N, E>(
bot: &'a Bot,
user_id: i32,
name: N,
png_sticker: InputFile,
emojis: E,
) -> Self
where
N: Into<String>,
E: Into<String>,
{
Self {
bot,
user_id,
name: name.into(),
png_sticker,
emojis: emojis.into(),
mask_position: None,
}
}
/// User identifier of sticker set owner.
pub fn user_id(mut self, val: i32) -> Self {
self.user_id = val;
self
}
/// Sticker set name.
pub fn name<T>(mut self, val: T) -> Self
where
T: Into<String>,
{
self.name = val.into();
self
}
/// **Png** image with the sticker, must be up to 512 kilobytes in size,
/// dimensions must not exceed 512px, and either width or height must be
/// exactly 512px.
///
/// Pass [`InputFile::File`] to send a file that exists on
/// the Telegram servers (recommended), pass an [`InputFile::Url`] for
/// Telegram to get a .webp file from the Internet, or upload a new one
/// using [`InputFile::FileId`]. [More info on Sending Files »].
///
/// [`InputFile::File`]: crate::types::InputFile::File
/// [`InputFile::Url`]: crate::types::InputFile::Url
/// [`InputFile::FileId`]: crate::types::InputFile::FileId
pub fn png_sticker(mut self, val: InputFile) -> Self {
self.png_sticker = val;
self
}
/// One or more emoji corresponding to the sticker.
pub fn emojis<T>(mut self, val: T) -> Self
where
T: Into<String>,
{
self.emojis = val.into();
self
}
/// A JSON-serialized object for position where the mask should be placed on
/// faces.
pub fn mask_position(mut self, val: MaskPosition) -> Self {
self.mask_position = Some(val);
self
}
}

View file

@ -1,15 +0,0 @@
use crate::{
network,
requests::form_builder::FormBuilder,
types::{InputFile, MaskPosition, True},
Bot,
};
use crate::requests::{Request, ResponseResult};
/// Use this method to add a new sticker to a set created by the bot.
///
/// [The official docs](https://core.telegram.org/bots/api#addstickertoset).
#[derive(Copy, Eq, PartialEq, Debug, Clone)]
pub struct AddStickerToSet<'a> {