Skip to main content

User

Represents a user in the system.
id
fixed64
Snowflake user ID
name
string
Display name of the user
username
string
Unique username (may be null)
status
UserStatus
Current online/idle status
photo
ChatPhoto
Profile photo
bot
bool
Whether this user is a bot account
icon
fixed64
Snowflake emoji ID for custom icon
color
uint32
Color code for user display

Protocol Definition

message User {
  fixed64 id = 1;  // @snowflake<User>
  string name = 2;
  optional string username = 3;
  optional UserStatus status = 4;
  optional ChatPhoto photo = 5;
  bool bot = 6;
  optional fixed64 icon = 7;  // @snowflake<Emoji>
  optional uint32 color = 8;
}

ChatPhoto

Represents a photo/avatar for a chat or user.
file_id
fixed64
Snowflake file ID referencing the full-resolution image
preview
bytes
Low-resolution preview data (thumbnail)

Protocol Definition

message ChatPhoto {
  fixed64 file_id = 1;  // @snowflake<File>
  bytes preview = 2;
}

UserStatus

Represents a user’s online/presence status.
online
bool
deprecated
Deprecated: Whether user is online
status
Status
Current status enum value

Status Enum

ONLINE
0
User is actively online
IDLE
1
User is idle/away

Protocol Definition

message UserStatus {
  enum Status {
    ONLINE = 0;
    IDLE = 1;
  }
  bool online = 2 [deprecated = true];
  optional Status status = 3;
}

Message

Represents a chat message.
chat_ref
refs.ChatRef
Reference to the chat containing this message
message_id
fixed64
Snowflake message ID
author_id
fixed64
Snowflake user ID of the message author
message
string
Message text content
reply_to
fixed64
Snowflake message ID being replied to
media
media.MessageMedia[]
Attached media items (images, videos, files, etc.)
entities
MessageEntity[]
Text formatting entities (bold, links, mentions, etc.)
edited_at
uint64
Unix timestamp when message was last edited
type
MessageType
Special message type (call, join, leave)
forward
MessageForwardInfo
Information about forwarded message origin

MessageType Enum

UNKNOWN
0
Unknown or regular message type
CALL
1
Voice/video call message
JOIN
2
User joined message
LEAVE
3
User left message

Protocol Definition

message Message {
  enum MessageType {
    UNKNOWN = 0;
    CALL = 1;
    JOIN = 2;
    LEAVE = 3;
  }

  message MessageForwardInfo {}

  refs.ChatRef chat_ref = 1;
  fixed64 message_id = 2;  // @snowflake<Message>
  fixed64 author_id = 3;  // @snowflake<User>
  string message = 4;
  optional fixed64 reply_to = 5;  // @snowflake<Message>
  repeated media.MessageMedia media = 6;
  repeated MessageEntity entities = 7;
  optional uint64 edited_at = 8;
  optional MessageType type = 9;
  optional MessageForwardInfo forward = 10;
}

MessageEntity

Represents text formatting in a message.
start_index
uint32
Starting character index (UTF-8 offset)
length
uint32
Length of the entity in characters
entity
oneof
The type of entity. Exactly one of:
bold
bool
Bold text formatting
italic
bool
Italic text formatting
underline
bool
Underline text formatting
strikethrough
bool
Strikethrough text formatting
code
bool
Inline code formatting
url
bool
Implicit URL (text content is the URL)
spoiler
SpoilerEntity
Spoiler text (hidden until clicked)
pre
PreEntity
Code block with optional language
textUrl
TextUrlEntity
Masked URL (display text differs from URL)
custom_emoji
CustomEmojiEntity
Custom emoji reference
user_mention
UserMentionEntity
User mention by ID
username
bool
User mention by username

Entity Types

CustomEmojiEntity

emoji_id
fixed64
Snowflake emoji ID

TextUrlEntity

url
string
The actual URL

PreEntity

language
string
Programming language for syntax highlighting

Protocol Definition

message MessageEntity {
  uint32 start_index = 1;
  uint32 length = 2;

  message CustomEmojiEntity {
    fixed64 emoji_id = 1;  // @snowflake<Emoji>
  }

  message TextUrlEntity { string url = 1; }
  message PreEntity { optional string language = 1; }
  message SpoilerEntity {}
  message UserMentionEntity {}

  oneof entity {
    bool bold = 3;
    bool italic = 4;
    bool underline = 5;
    bool strikethrough = 6;
    bool code = 7;
    bool url = 8;
    SpoilerEntity spoiler = 9;
    PreEntity pre = 10;
    TextUrlEntity textUrl = 11;
    CustomEmojiEntity custom_emoji = 12;
    UserMentionEntity user_mention = 13;
    bool username = 14;
  }
}

Channel

Represents a channel within a community.
id
fixed64
Snowflake channel ID
community_id
fixed64
Snowflake community ID this channel belongs to
name
string
Channel name
type
ChannelType
Channel type (text, voice, category)
position
uint32
Sort position within the community
parent_id
fixed64
Snowflake channel ID of parent category (if any)

Protocol Definition

message Channel {
  fixed64 id = 1;  // @snowflake<Channel>
  fixed64 community_id = 2;  // @snowflake<Community>
  string name = 3;
  ChannelType type = 4;
  uint32 position = 5;
  optional fixed64 parent_id = 6;  // @snowflake<Channel>
}

ChannelType

Enum defining channel types.
TEXT
0
Text channel
VOICE
1
Voice channel
CATEGORY
2
Category (container for other channels)

Protocol Definition

enum ChannelType {
  TEXT = 0;
  VOICE = 1;
  CATEGORY = 2;
}

Community

Represents a community (server/guild).
id
fixed64
Snowflake community ID
owner
bool
Whether the current user owns this community
name
string
Community name
photo
ChatPhoto
Community icon/photo
permissions
fixed64
User’s permission bitfield for this community
muted
bool
Whether notifications are muted

Protocol Definition

message Community {
  fixed64 id = 1;  // @snowflake<Community>
  bool owner = 2;
  string name = 3;
  optional ChatPhoto photo = 4;
  fixed64 permissions = 5;
  bool muted = 6;
}

CommunityMember

Represents a member of a community.
id
fixed64
Snowflake user ID
community_id
fixed64
Snowflake community ID
role_ids
fixed64[]
Array of snowflake role IDs assigned to this member
nickname
string
Community-specific nickname

Protocol Definition

message CommunityMember {
  fixed64 id = 1;  // @snowflake<User>
  fixed64 community_id = 2;  // @snowflake<Community>
  repeated fixed64 role_ids = 3;  // @snowflake<Role>
  optional string nickname = 4;
}

CommunityRole

Represents a role in a community.
id
fixed64
Snowflake role ID
community_id
fixed64
Snowflake community ID
name
string
Role name
permissions
fixed64
Permission bitfield for this role
priority
uint32
Role priority/hierarchy (higher = more important)
color
uint32
Display color for role
separated
bool
Whether to display members with this role separately in member list
public
bool
Whether this role is publicly assignable

Protocol Definition

message CommunityRole {
  fixed64 id = 1;  // @snowflake<Role>
  fixed64 community_id = 2;  // @snowflake<Community>
  string name = 3;
  fixed64 permissions = 4;
  uint32 priority = 5;
  uint32 color = 6;
  bool separated = 7;
  bool public = 8;
}

CommunityPermission

Enum defining community permission flags (bitfield).
NO_PERMISSION
0
No permissions (0)
ADMINISTRATOR
1
Full administrator access (1 << 0)
VIEW_CHANNEL
2
View channels (1 << 1)
SEND_MESSAGES
4
Send messages in text channels (1 << 2)
CONNECT_VOICE
8
Connect to voice channels (1 << 3)
MODIFY_CHANNEL
16
Modify channel settings (1 << 4)
SEND_MEDIA
32
Send media attachments (1 << 5)
DELETE_MESSAGES
64
Delete other users’ messages (1 << 6)
PIN_MESSAGES
128
Pin messages (1 << 7)
SPEAK_VOICE
256
Speak in voice channels (1 << 8)
MODIFY_COMMUNITY
512
Modify community settings (1 << 9)
MODIFY_ROLES
1024
Manage roles (1 << 10)
REMOVE_MEMBERS
2048
Kick/ban members (1 << 11)

Protocol Definition

enum CommunityPermission {
  NO_PERMISSION = 0;
  ADMINISTRATOR = 1;      // 1<<0
  VIEW_CHANNEL = 2;       // 1<<1
  SEND_MESSAGES = 4;      // 1<<2
  CONNECT_VOICE = 8;      // 1<<3
  MODIFY_CHANNEL = 16;    // 1<<4
  SEND_MEDIA = 32;        // 1<<5
  DELETE_MESSAGES = 64;   // 1<<6
  PIN_MESSAGES = 128;     // 1<<7
  SPEAK_VOICE = 256;      // 1<<8
  MODIFY_COMMUNITY = 512; // 1<<9
  MODIFY_ROLES = 1024;    // 1<<10
  REMOVE_MEMBERS = 2048;  // 1<<11
}

PermissionOverrides

Represents permission overrides (positive and negative).
pos
fixed64
Positive permission bitfield (allowed permissions)
neg
fixed64
Negative permission bitfield (denied permissions)

Protocol Definition

message PermissionOverrides {
  fixed64 pos = 1;
  fixed64 neg = 2;
}

ChannelOverride

Represents channel-specific permission overrides for a role.
community_id
fixed64
Snowflake community ID
channel_id
fixed64
Snowflake channel ID
role_id
fixed64
Snowflake role ID
permissions
PermissionOverrides
Permission overrides for this role in this channel

Protocol Definition

message ChannelOverride {
  fixed64 community_id = 1;  // @snowflake<Community>
  fixed64 channel_id = 2;    // @snowflake<Channel>
  fixed64 role_id = 3;       // @snowflake<Role>
  PermissionOverrides permissions = 4;
}

Group

Represents a group chat.
id
fixed64
Snowflake chat ID
name
string
Group name
owner
bool
Whether the current user owns this group
participant_ids
fixed64[]
Array of snowflake user IDs of participants

Protocol Definition

message Group {
  fixed64 id = 1;  // @snowflake<Chat>
  string name = 2;
  bool owner = 3;
  repeated fixed64 participant_ids = 4;  // @snowflake<User>
}

Conversation

Represents a conversation entry in the user’s chat list.
chat_ref
refs.ChatRef
Reference to the chat
last_message_id
fixed64
Snowflake message ID of last message (or chat ID if no messages)
last_read_message_id
fixed64
Snowflake message ID of last read message
unread_count
uint32
Number of unread messages
draft
string
Unsent draft message text
permissions
PermissionOverrides
User’s permission overrides for this chat
muted
bool
Whether notifications are muted for this conversation

Protocol Definition

message Conversation {
  refs.ChatRef chat_ref = 1;
  fixed64 last_message_id = 2;      // @snowflake<Message>
  fixed64 last_read_message_id = 3; // @snowflake<Message>
  reserved 4;
  uint32 unread_count = 5;
  optional string draft = 6;
  optional PermissionOverrides permissions = 7;
  bool muted = 8;
}

RelationshipStatus

Enum defining friend relationship statuses.
INVALID
0
Invalid/no relationship
FRIEND
1
Confirmed friend
FRIEND_REQUEST_INCOMING
2
Incoming friend request (they sent to you)
FRIEND_REQUEST_OUTGOING
3
Outgoing friend request (you sent to them)
BLOCKED
4
User is blocked
SUGGESTED_FRIEND
5
Suggested friend

Protocol Definition

enum RelationshipStatus {
  INVALID = 0;
  FRIEND = 1;
  FRIEND_REQUEST_INCOMING = 2;
  FRIEND_REQUEST_OUTGOING = 3;
  BLOCKED = 4;
  SUGGESTED_FRIEND = 5;
}

Relationship

Represents a relationship between users.
user_id
fixed64
Snowflake user ID of the other user
status
RelationshipStatus
Relationship status

Protocol Definition

message Relationship {
  fixed64 user_id = 1;  // @snowflake<User>
  RelationshipStatus status = 2;
}

Entrypoint

Represents a server entrypoint for connection.
hostname
string
Server hostname
ip_address
string
Server IP address
port
uint32
Server port number
region
uint32
Region identifier

Protocol Definition

message Entrypoint {
  string hostname = 1;
  optional string ip_address = 2;
  uint32 port = 3;
  uint32 region = 4;
}

Build docs developers (and LLMs) love