freechat/docs/structures.md
2020-05-25 13:40:19 -07:00

797 B

Structures

Below are various structures that client builds can expect to receive. These are not representative of how instances internally store data but what a client can expect to receive from different API requests.

  1. Member
Member {
	name: string
	id: u64
	permissions: u64
	badges: List<Badge>
}
  1. Channel
Channel {
	name: string
	description: string
	type: integer [1=Voice Channel, 2=Text Channel]
}
  1. Message

While Message responses don't specify what channel they belong a channel does have to be used to request these so it's up to the client to store these in a way that makes sense.

Message {
	author: Member
	date: u64 -> [unix timestamp since epoch]
	content: string
}
  1. Badge
Badge {
	name: string
	permissions: u64
	color: u32
}