Remove #[macro_use] and use use instead

This commit is contained in:
Waffle 2019-12-30 13:14:19 +03:00
parent 0c0e1014c1
commit 51703b16b1
153 changed files with 292 additions and 23 deletions

View file

@ -1,4 +1,6 @@
use derive_more::From;
use reqwest::StatusCode;
use thiserror::Error;
//<editor-fold desc="download">
#[derive(Debug, Error, From)]

View file

@ -5,13 +5,6 @@
html_favicon_url = "https://github.com/teloxide/teloxide/raw/dev/ICON.png"
)]
#[macro_use]
extern crate derive_more;
#[macro_use]
extern crate serde;
#[macro_use]
extern crate thiserror;
pub use bot::Bot;
pub use errors::{DownloadError, RequestError};

View file

@ -1,4 +1,5 @@
use reqwest::StatusCode;
use serde::Deserialize;
use crate::{
requests::ResponseResult,

View file

@ -1,3 +1,4 @@
use serde::{Deserialize, Serialize};
use reqwest::multipart::Form;
use crate::{

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
use crate::{
requests::{dynamic, json, Method},
types::True,

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
use crate::{
requests::{dynamic, json, Method},
types::InlineQueryResult,

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
use crate::{
requests::{dynamic, json, Method},
types::True,

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
use crate::{
requests::{dynamic, json, Method},
types::{ShippingOption, True},

View file

@ -1,3 +1,4 @@
use serde::{Deserialize, Serialize};
use reqwest::multipart::Form;
use crate::{

View file

@ -1,7 +1,9 @@
use serde::{Deserialize, Serialize};
use crate::{
requests::{dynamic, json, Method},
types::{ChatId, True},
};
use crate::types::{ChatId, True};
/// Use this method to delete a chat photo. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns True on success.
#[serde_with_macros::skip_serializing_none]

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
use crate::{
requests::{dynamic, json, Method},
types::{ChatId, True},

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
use crate::{
requests::{dynamic, json, Method},
types::{ChatId, True},

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
use crate::{
requests::{dynamic, json, Method},
types::True,

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
use crate::{
requests::{dynamic, json, Method},
types::True,

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
use crate::{
requests::{dynamic, json, Method},
types::{ChatId, ParseMode, InlineKeyboardMarkup, Message},

View file

@ -1,10 +1,9 @@
use serde::{Deserialize, Serialize};
use crate::{
requests::{dynamic, json, Method},
types::{ParseMode, InlineKeyboardMarkup},
types::{ParseMode, InlineKeyboardMarkup, Message},
};
use crate::types::Message;
/// Use this method to edit captions of messages. On success, if edited message is sent by the bot, the edited Message is returned, otherwise True is returned.
#[serde_with_macros::skip_serializing_none]

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
use crate::{
requests::{dynamic, json, Method},
types::{ChatId, InlineKeyboardMarkup, Message},

View file

@ -1,3 +1,4 @@
use serde::{Deserialize, Serialize};
use crate::{
requests::{dynamic, json, Method},

View file

@ -1,3 +1,4 @@
use serde::{Deserialize, Serialize};
use reqwest::multipart::Form;
use crate::{

View file

@ -1,3 +1,4 @@
use serde::{Deserialize, Serialize};
use reqwest::multipart::Form;
use crate::{

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
use crate::{
requests::{dynamic, json, Method},
types::{ChatId, InlineKeyboardMarkup, Message},

View file

@ -1,3 +1,4 @@
use serde::{Deserialize, Serialize};
use crate::{
requests::{dynamic, json, Method},

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
use crate::{
requests::{dynamic, json, Method},
types::{ChatId, ParseMode, InlineKeyboardMarkup, Message},

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
use crate::{
requests::{dynamic, json, Method},
types::{ParseMode, InlineKeyboardMarkup, Message},

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
use crate::{
requests::{dynamic, json, Method},
types::ChatId,

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
use crate::{
requests::{dynamic, json, Method},
types::{ChatId, Message},

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
use crate::{
requests::{dynamic, json, Method},
types::{ChatId, Chat},

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
use crate::{
requests::{dynamic, json, Method},
types::{ChatId, ChatMember},

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
use crate::{
requests::{dynamic, json, Method},
types::{ChatId, ChatMember},

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
use crate::{
requests::{dynamic, json, Method},
types::ChatId,

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
use crate::{
requests::{dynamic, json, Method},
types::File,

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
use crate::{
requests::{dynamic, json, Method},
types::GameHighScore,

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
use crate::{
requests::{dynamic, json, Method},
types::GameHighScore,

View file

@ -1,3 +1,4 @@
use serde::{Deserialize, Serialize};
use crate::{
requests::{dynamic, json, Method},
types::User,

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
use crate::{
requests::{dynamic, json, Method},
types::StickerSet,

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
use crate::{
requests::{dynamic, json, Method},
types::Update,

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
use crate::{
requests::{dynamic, json, Method},
types::UserProfilePhotos,

View file

@ -1,7 +1,9 @@
use serde::{Deserialize, Serialize};
use crate::{
requests::{dynamic, json, Method},
types::WebhookInfo,
};
use crate::types::WebhookInfo;
/// Use this method to get current webhook status. Requires no parameters. On success, returns a WebhookInfo object. If the bot is using getUpdates, will return an object with the url field empty.
#[derive(Debug, PartialEq, Eq, Hash, Clone, Deserialize, Serialize, Default)]

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
use crate::{
requests::{dynamic, json, Method},
types::{ChatId, True},

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
use crate::{
requests::{dynamic, json, Method},
types::{ChatId, True},

View file

@ -1,7 +1,9 @@
use serde::{Deserialize, Serialize};
use crate::{
requests::{dynamic, json, Method},
types::{ChatId, True},
};
use crate::types::{ChatId, True};
/// Use this method to pin a message in a group, a supergroup, or a channel. The bot must be an administrator in the chat for this to work and must have the can_pin_messages admin right in the supergroup or can_edit_messages admin right in the channel. Returns True on success.
#[serde_with_macros::skip_serializing_none]

View file

@ -1,7 +1,9 @@
use serde::{Deserialize, Serialize};
use crate::{
requests::{dynamic, json, Method},
types::{ChatId, True},
};
use crate::types::{ChatId, True};
/// Use this method to promote or demote a user in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Pass False for all boolean parameters to demote a user. Returns True on success.
#[serde_with_macros::skip_serializing_none]

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
use crate::{
requests::{dynamic, json, Method},
types::{ChatId, ChatPermissions, True},

View file

@ -1,3 +1,4 @@
use serde::{Deserialize, Serialize};
use reqwest::multipart::Form;
use crate::{

View file

@ -1,3 +1,4 @@
use serde::{Deserialize, Serialize};
use reqwest::multipart::Form;
use crate::{

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
use crate::{
requests::{dynamic, json, Method},
types::{ChatId, True},

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
use crate::{
requests::{dynamic, json, Method},
types::{ChatId, ReplyMarkup, Message},

View file

@ -1,3 +1,4 @@
use serde::{Deserialize, Serialize};
use reqwest::multipart::Form;
use crate::{

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
use crate::{
requests::{dynamic, json, Method},
types::{InlineKeyboardMarkup, Message},

View file

@ -1,7 +1,9 @@
use serde::{Deserialize, Serialize};
use crate::{
requests::{dynamic, json, Method},
types::{LabeledPrice, InlineKeyboardMarkup, Message},
};
use crate::types::{LabeledPrice, InlineKeyboardMarkup, Message};
/// Use this method to send invoices. On success, the sent Message is returned.
#[serde_with_macros::skip_serializing_none]

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
use crate::{
requests::{dynamic, json, Method},
types::{ChatId, ReplyMarkup, Message},

View file

@ -1,3 +1,4 @@
use serde::{Deserialize, Serialize};
use reqwest::multipart::Form;
use crate::{

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
use crate::{
requests::{dynamic, json, Method},
types::{ChatId, Message, ParseMode, ReplyMarkup},

View file

@ -1,3 +1,4 @@
use serde::{Deserialize, Serialize};
use reqwest::multipart::Form;
use crate::{

View file

@ -1,7 +1,9 @@
use serde::{Deserialize, Serialize};
use crate::{
requests::{dynamic, json, Method},
types::{ChatId, ReplyMarkup, Message},
};
use crate::types::{ChatId, ReplyMarkup, Message};
/// Use this method to send a native poll. A native poll can't be sent to a private chat. On success, the sent Message is returned.
#[serde_with_macros::skip_serializing_none]

View file

@ -1,3 +1,4 @@
use serde::{Deserialize, Serialize};
use reqwest::multipart::Form;
use crate::{

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
use crate::{
requests::{dynamic, json, Method},
types::{ChatId, ReplyMarkup, Message},

View file

@ -1,3 +1,4 @@
use serde::{Deserialize, Serialize};
use reqwest::multipart::Form;
use crate::{

View file

@ -1,3 +1,4 @@
use serde::{Deserialize, Serialize};
use reqwest::multipart::Form;
use crate::{

View file

@ -1,3 +1,4 @@
use serde::{Deserialize, Serialize};
use reqwest::multipart::Form;
use crate::{

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
use crate::{
requests::{dynamic, json, Method},
types::{ChatId, True},

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
use crate::{
requests::{dynamic, json, Method},
types::{ChatId, ChatPermissions, True},

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
use crate::{
requests::{dynamic, json, Method},
types::{ChatId, InputFile, True},

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
use crate::{
requests::{dynamic, json, Method},
types::{ChatId, True},

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
use crate::{
requests::{dynamic, json, Method},
types::{ChatId, True},

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
use crate::{
requests::{dynamic, json, Method},
types::{Message, ChatId},

View file

@ -1,3 +1,4 @@
use serde::{Deserialize, Serialize};
use crate::{
requests::{dynamic, json, Method},

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
use crate::{
requests::{dynamic, json, Method},
types::True,

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
use crate::{
requests::{dynamic, json, Method},
types::{InputFile, True},

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
use crate::{
requests::{dynamic, json, Method},
types::{ChatId, InlineKeyboardMarkup, Message},

View file

@ -1,4 +1,4 @@
use serde::{Deserialize, Serialize};
use crate::{
requests::{dynamic, json, Method},

View file

@ -1,8 +1,9 @@
use serde::{Deserialize, Serialize};
use crate::{
requests::{dynamic, json, Method},
types::{ChatId, InlineKeyboardMarkup},
types::{ChatId, InlineKeyboardMarkup, Poll},
};
use crate::types::Poll;
/// Use this method to stop a poll which was sent by the bot. On success, the stopped Poll with the final results is returned.
#[serde_with_macros::skip_serializing_none]

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
use crate::{
requests::{dynamic, json, Method},
types::{ChatId, True},

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
use crate::{
requests::{dynamic, json, Method},
types::{ChatId, True},

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
use crate::{
requests::{dynamic, json, Method},
types::{InputFile, File},

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
use crate::types::PhotoSize;
/// This object represents an animation file (GIF or H.264/MPEG-4 AVC video

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
use crate::types::PhotoSize;
/// This object represents an audio file to be treated as music by the Telegram

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
use crate::types::{Message, User};
/// This object represents an incoming callback query from a callback button in

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
use crate::types::{ChatPermissions, ChatPhoto, Message};
/// This object represents a chat.

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum ChatAction {

View file

@ -1,3 +1,6 @@
use derive_more::{Display, From};
use serde::{Deserialize, Serialize};
/// A unique identifier for the target chat or username of the target channel
/// (in the format `@channelusername`).
#[derive(

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
use crate::types::User;
/// This object contains information about one member of the chat.

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
/// Describes actions that a non-administrator user is allowed to take in a
/// chat.
///

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
/// This object represents a chat photo.
///
/// [The official docs](https://core.telegram.org/bots/api#chatphoto).

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
use crate::types::{Location, User};
/// Represents a [result] of an inline query that was chosen by the user and

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
/// This object represents a phone contact.
///
/// [The official docs](https://core.telegram.org/bots/api#contact).

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
use crate::types::PhotoSize;
/// This object represents a general file (as opposed to [photos], [voice

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
/// Contains data required for decrypting and authenticating
/// [`EncryptedPassportElement`]. See the [Telegram Passport Documentation] for
/// a complete description of the data decryption and authentication processes.

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
use super::PassportFile;
/// Contains information about documents or other Telegram Passport elements

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
/// This object represents a file ready to be downloaded. The file can be
/// downloaded via the link `https://api.telegram.org/file/bot<token>/<file_path>`.
/// It is guaranteed that the link will be valid for at least 1 hour. When the

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
use crate::types::True;
/// Upon receiving a message with this object, Telegram clients will display a

View file

@ -1,4 +1,4 @@
use serde::Deserialize;
use serde::{Deserialize, Serialize};
use crate::types::{Animation, MessageEntity, PhotoSize};

View file

@ -1,4 +1,4 @@
use serde::Deserialize;
use serde::{Deserialize, Serialize};
use crate::types::user::User;

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
/// This object represents one button of an inline keyboard.
///
/// [The official docs](https://core.telegram.org/bots/api#inlinekeyboardbutton).

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
use crate::types::InlineKeyboardButton;
/// This object represents an [inline keyboard] that appears right next to the

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
use crate::types::{Location, User};
/// This object represents an incoming inline query. When the user sends an

View file

@ -1,5 +1,8 @@
#![allow(clippy::large_enum_variant)]
use derive_more::From;
use serde::{Deserialize, Serialize};
use crate::types::{
InlineQueryResultArticle, InlineQueryResultAudio,
InlineQueryResultCachedAudio, InlineQueryResultCachedDocument,

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
use crate::types::{InlineKeyboardMarkup, InputMessageContent};
/// Represents a link to an article or web page.

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
use crate::types::{InlineKeyboardMarkup, InputMessageContent, ParseMode};
/// Represents a link to an MP3 audio file. By default, this audio file will be

View file

@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};
use crate::types::{InlineKeyboardMarkup, InputMessageContent, ParseMode};
/// Represents a link to an MP3 audio file stored on the Telegram servers. By

Some files were not shown because too many files have changed in this diff Show more