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
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
//! Wrappers altering functionality of a bot.
//!
//! Bot adaptors are very similar to the [`Iterator`] adaptors: they are bots
//! wrapping other bots to alter existing or add new functionality.
//!
//! E.g. [`AutoSend`] allows `await`ing requests directly, no need to use
//! `.send()`.
//!
//! [`Requester`]: crate::requests::Requester

/// [`AutoSend`] bot adaptor which allows sending a request without calling
/// [`send`].
///
/// [`AutoSend`]: auto_send::AutoSend
/// [`send`]: crate::requests::Request::send
#[cfg(feature = "auto_send")]
#[cfg_attr(
    all(any(docsrs, dep_docsrs), feature = "nightly"),
    doc(cfg(feature = "auto_send"))
)]
pub mod auto_send;

/// [`CacheMe`] bot adaptor which caches [`GetMe`] requests.
///
/// [`CacheMe`]: cache_me::CacheMe
/// [`GetMe`]: crate::payloads::GetMe
#[cfg(feature = "cache_me")]
#[cfg_attr(
    all(any(docsrs, dep_docsrs), feature = "nightly"),
    doc(cfg(feature = "cache_me"))
)]
pub mod cache_me;

/// [`Trace`] bot adaptor which traces requests.
///
/// [`Trace`]: trace::Trace
#[cfg(feature = "trace_adaptor")]
#[cfg_attr(
    all(any(docsrs, dep_docsrs), feature = "nightly"),
    doc(cfg(feature = "trace_adaptor"))
)]
pub mod trace;

/// [`ErasedRequester`] bot adaptor which allows to erase type of
/// [`Requester`].
///
/// [`ErasedRequester`]: erased::ErasedRequester
/// [`Requester`]: crate::requests::Requester
#[cfg(feature = "erased")]
#[cfg_attr(
    all(any(docsrs, dep_docsrs), feature = "nightly"),
    doc(cfg(feature = "erased"))
)]
pub mod erased;

/// [`Throttle`] bot adaptor which allows automatically throttle when hitting
/// API limits.
///
/// [`Throttle`]: throttle::Throttle
#[cfg(feature = "throttle")]
#[cfg_attr(
    all(any(docsrs, dep_docsrs), feature = "nightly"),
    doc(cfg(feature = "throttle"))
)]
pub mod throttle;

mod parse_mode;

#[cfg(feature = "auto_send")]
#[cfg_attr(
    all(any(docsrs, dep_docsrs), feature = "nightly"),
    doc(cfg(feature = "auto_send"))
)]
pub use auto_send::AutoSend;
#[cfg(feature = "cache_me")]
#[cfg_attr(
    all(any(docsrs, dep_docsrs), feature = "nightly"),
    doc(cfg(feature = "cache_me"))
)]
pub use cache_me::CacheMe;
#[cfg(feature = "erased")]
#[cfg_attr(
    all(any(docsrs, dep_docsrs), feature = "nightly"),
    doc(cfg(feature = "erased"))
)]
pub use erased::ErasedRequester;
#[cfg(feature = "throttle")]
#[cfg_attr(
    all(any(docsrs, dep_docsrs), feature = "nightly"),
    doc(cfg(feature = "throttle"))
)]
pub use throttle::Throttle;
#[cfg(feature = "trace_adaptor")]
#[cfg_attr(
    all(any(docsrs, dep_docsrs), feature = "nightly"),
    doc(cfg(feature = "trace_adaptor"))
)]
pub use trace::Trace;

pub use parse_mode::DefaultParseMode;