A repository full of manually generated hand curated JSON files, which contain the API Types that the Discord API returns.

Overview

Discord API Types

A repository full of manually generated hand curated JSON files, which contain the API Types that the Discord API returns.

Also did I mention that everything in ./src can be parsed easily! That means you can write a parser to generate classes/structs/enums/etc for your Discord API wrapper or bot!

Primitive Types

  • null
  • string
  • integer
  • float
  • bool
  • array[{type}]

{type} can either be a primitive type, advanced type or a special type

Advanced Types

Advanced Types are PascalCased and are scattered around ./src, "advanced types" are basically the objects the API returns

All keys are sorted alphabetically in an advanced type, but the types itself might be sorted by relevance

Special Types

These types are just to make life easier

  • union[{types}] Used when the type can be one or more primitive and/or advanced objects
  • enum[{enum}] Used when the type is from an enum
  • snowflake Used as an alias to string, mainly exists because people might want to have their own custom implementation of sorts for a snowflake type
  • timestamp an ISO-8601 timestamp

The Schema

This is the base schema:

{name}: {
    "type": {type},
    "required": {true|false},
    "nullable": {true|false},
}

type: can either be a primitive or an advanced type
required: if this is true then the field is required to be sent in the payload
nullable: if this is true, then the feild can be sent as null in the payload

Examples

Payload with fields

"Hello": {
    "_trace": {
        "type": "array[string]",
        "required": true,
        "nullable": false
    },
    "heartbeat_interval": {
        "type": "integer",
        "required": true,
        "nullable": false
    }
}

Payload with NO fields

"Heartbeat": {
    "type": "integer",
    "required": true,
    "nullable": true
}

Notes

The payload format is not mentioned in any of the files in ./src
But it is understood that you interpret it as this:

"GatewayPayload": {
    "d": {
        "type": "union[Identify, ConnectionProperties, Resume, Heartbeat, RequestGuildMembers, UpdateVoiceState, UpdatePresence, Hello, Ready, Resumed, Reconnect, InvalidSession, ChannelCreate, ChannelUpdate, ChannelDelete, ChannelPinsUpdate, ThreadCreate, ThreadUpdate, ThreadDelete, ThreadListSync, ThreadMemberUpdate, ThreadMembersUpdate, GuildCreate, GuildUpdate, GuildDelete, GuildBanAdd, GuildBanRemove, GuildEmojisUpdate, GuildStickersUpdate, GuildIntegrationsUpdate, GuildMemberAdd, GuildMemberRemove, GuildMemberUpdate, GuildMembersChunk, GuildRoleCreate, GuildRoleUpdate, GuildRoleDelete, GuildScheduledEventCreate, GuildScheduledEventUpdate, GuildScheduledEventDelete, GuildScheduledEventUserAdd, GuildScheduledEventUserRemove, IntegrationCreate, IntegrationUpdate, IntegrationDelete, InteractionCreate, InviteCreate, InviteDelete, MessageCreate, MessageUpdate, MessageDelete, MessageDeleteBulk, MessageReactionAdd, MessageReactionRemove, MessageReactionRemoveAll, MessageReactionRemoveEmoji, PresenceUpdate, StageInstanceCreate, StageInstanceDelete, StageInstanceUpdate, TypingStart, UserUpdate, VoiceStateUpdate, VoiceServerUpdate, WebhooksUpdate]",
        "required": true,
        "nullable": true
    },
    "op": {
        "type": "integer",
        "required": true,
        "nullable": false
    },
    "s": {
        "type": "union[integer, null]",
        "required": false,
        "nullable": true
    },
    "t": {
        "type": "union[string, null]",
        "required": false,
        "nullable": true
    }
},
You might also like...
A repository containing dozens of projects requiring vastly different skillsets.
A repository containing dozens of projects requiring vastly different skillsets.

The 100 Project Challenge A repository containing dozens of projects requiring vastly different skillsets. All the projects that I might add to this r

Telegram bot for searching in Arch User Repository ( AUR ); Implemented using rust.

AurSearchBot A Telegram Inline Search Bot Written in Rust Introduction Telegram Bot that can search AUR ( Arch User Repository ) in inline mode. This

This repository provides an emulator for iterated prisoner's dilemma.

Iterated Prisoner's Dilemma Emulator Name This repository provides an emulator for iterated prisoner's dilemma. Description You can run the program by

This repository simulates and renders fluid particles in two dimensions, in Rust.

mlsmpm-particles-rs This repository simulates and renders fluid particles in two dimensions, in Rust. My matching implementation in Go is mlsmpm-parti

A repository of examples for esp32s3-box written in Rust
A repository of examples for esp32s3-box written in Rust

ESP32S3-BOX Examples A repository of examples for esp32s3-box written in Rust Usage hello world cargo espflash --release --monitor esp demo animati

Traits for inspecting memory usage of Rust types

memuse This crate contains traits for measuring the dynamic memory usage of Rust types. About Memory-tracking is a common activity in large applicatio

A list of known SS58 account types as an enum.

A list of known SS58 account types as an enum.

🪣 Types for a `Vec`'s raw parts

raw-parts A wrapper around the decomposed parts of a VecT. This struct contains the Vec's internal pointer, length, and allocated capacity. RawParts

Annoyed that Rust has many string types? Well it doesn't have to

generic-str The one true string type in Rust! This project intends to be a proof-of-concept for an idea I had a few months back. There is lots of unsa

Owner
Unofficial Discord Documentation
Unofficial Discord Documentation
▦⧉□▣ A curated list of links to miniquad/macroquad-related code & resources

Awesome Quads A curated list of links to miniquad/macroquad-related code & resources. Game engines miniquad - main crate, engines below build on top o

Andréy Lesnikóv 107 Dec 26, 2022
Pbot - pan93412's extensible userbot, which is full-documented, enginnered and based on Actor model.

pbot pan93412's extensible user bot, which is full-documented, engineered and based on Actor model. Usage Run cargo run --release [--features <modules

pan93412 4 Feb 28, 2022
Schema2000 is a tool that parses exsiting JSON documents and tries to derive a JSON schema from these documents.

Schema 2000 Schema2000 is a tool that parses exsiting JSON documents and tries to derive a JSON schema from these documents. Currently, Schema2000 is

REWE Digital GmbH 12 Dec 6, 2022
A Discord bot focused on addressing the inherent problems with Discord, to allow a more socialist/anarchist organization of servers.

ACABot A Discord bot focused on addressing the inherent problems with Discord, to allow a more socialist/anarchist organization of servers (or "guilds

null 4 May 3, 2022
A rust(serenity) based discord bot for the hacksquad discord server

A Discord Bot for Hacksquad How to Deploy? Requirements Docker Docker Compose Steps To Run Copy the docker-compose.yml and .env.example files to your

HackSquad 5 Jan 4, 2023
Generated Ryst of Apache Arrow spec

Arrow generated IPC format The generated flatbuffers code for Rust. Note that these files suffered modifications because flatbuffers is unable to comp

null 14 Nov 30, 2022
A Discord bot for sending GeoGuessr challenge links that uses the GeoGuessr API written in rust.

GeoGuessr-bot-rs This is a simple implementation of a discord bot that send GeoGuessr-challenge links on demand. Features: Slash-commands Lightning-fa

Luukas Pörtfors 6 Nov 18, 2022
A high-level Rust crate around the Discord API, aimed to be easy and straight-forward to use.

rs-cord A high-level Rust crate around the Discord API, aimed to be easy and straight-forward to use. Documentation • Crates.io • Discord Navigation M

Jay3332 4 Sep 24, 2022
Serenity is a Rust library for the Discord API

serenity Serenity is a Rust library for the Discord API. View the examples on how to make and structure a bot. Serenity supports bot login via the use

serenity 3.3k Jan 2, 2023
Source code and documentation for our 'full stack on rust' meetup on 29-9-2022

Full stack on Rust This is the code and documentation repository for our 'Full stack on Rust' meetup on 29-9-2022. It includes step-by-step documentat

Baseflow 7 Oct 23, 2022