pub fn token(mut self, token: impl Into<String>) -> Self {
        let mut token = token.into();

        let is_bot = token.starts_with("Bot ");
        let is_bearer = token.starts_with("Bearer ");

        // Make sure it is either a bot or bearer token, and assume it's a bot
        // token if no prefix is given
        if !is_bot && !is_bearer {
            // do nothing lol
            //token.insert_str(0, "Bot ");
        }

        self.token.replace(token.into_boxed_str());

        self
    }
/// Set the token to use for HTTP requests.
Set the token to use for HTTP requests.
Set the token to use for HTTP requests .
pub fn token(mut self, token: impl Into<String>) -> Self {
        let mut token = token.into();
        let is_bot = token.starts_with("Bot ");
        let is_bearer = token.starts_with("Bearer ");
        // Make sure it is either a bot or bearer token, and assume it's a bot
        // token if no prefix is given
        if !is_bot && !is_bearer {
            // do nothing lol
            //token.insert_str(0, "Bot ");
        }
        self.token.replace(token.into_boxed_str());
        self
    }
pub fn token ( mut self , token : impl Into < String > ) -> Self { let mut token = token . into ( ) ; let is_bot = token . starts_with ( " " ) ; let is_bearer = token . starts_with ( " " ) ; // Make sure it is either a bot or bearer token, and assume it's a bot // token if no prefix is given if ! is_bot && ! is_bearer { // do nothing lol //token.insert_str(0, "Bot "); } self . token . replace ( token . into_boxed_str ( ) ) ; self }
Set the token to use for HTTP requests.
Set the token to use for HTTP requests .
mut self
token
impl Into<String>
mut self
token
impl Into<String>