botrs 0.12.1

A Rust QQ Bot framework based on QQ Guild Bot API
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use super::{BotApi, resource};
use crate::error::Result;
use crate::models::api::GatewayResponse;
use crate::token::Token;
use tracing::debug;

impl BotApi {
    /// Fetches gateway URL and session-start limits for websocket startup.
    pub async fn get_gateway(&self, token: &Token) -> Result<GatewayResponse> {
        debug!("Getting gateway URL");
        let response = self
            .http
            .get(token, resource::GATEWAY_BOT, None::<&()>)
            .await?;
        Self::decode_json(response)
    }
}