glyph/clients/api

This contains the client for communicating with Discord’s REST API.

Types

pub type APIClient {
  APIClient(
    token_type: rest.TokenType,
    token: String,
    client_url: String,
    client_version: String,
  )
}

Constructors

  • APIClient(
      token_type: rest.TokenType,
      token: String,
      client_url: String,
      client_version: String,
    )
pub type APIError {
  HackneyError
  DecodeError
}

Constructors

  • HackneyError
  • DecodeError

Functions

pub fn create_message(
  c: APIClient,
  channel_id: String,
  message: MessagePayload,
) -> Result(Nil, APIError)
pub fn get_application(
  c: APIClient,
) -> Result(Application, APIError)
pub fn get_gateway_bot(
  c: APIClient,
) -> Result(GetGatewayBot, APIError)
pub fn new(
  token: String,
  client_url: String,
  client_version: String,
) -> APIClient

Construct a new APIClient

Search Document