botrs 0.13.0

A Rust QQ Bot framework based on QQ Guild Bot API
Documentation
1
2
3
4
5
6
7
8
9
10
use crate::error::session_limit_error;
use crate::models::api::GatewayResponse;

pub(crate) fn check_session_limit(ap_info: &GatewayResponse) -> crate::Result<()> {
    if ap_info.shards > ap_info.session_start_limit.remaining {
        Err(session_limit_error().into())
    } else {
        Ok(())
    }
}