Documentation
¶
Index ¶
- Constants
- type Authenticate
- type Authenticated
- type BeginTyping
- type Channel
- type ChannelAck
- type ChannelCreate
- type ChannelDelete
- type ChannelGroupJoin
- type ChannelGroupLeave
- type ChannelStartTyping
- type ChannelStopTyping
- type ChannelUpdate
- type EndTyping
- type Error
- type File
- type Guild
- type GuildCategory
- type GuildMember
- type GuildMemberIDs
- type GuildRole
- type GuildSystemMessages
- type ImageCreateArguments
- type ImageOpts
- type Message
- type MessageContent
- type MessageCreate
- type MessageDelete
- type MessageRequest
- type MessageUpdate
- type Metadata
- type Ping
- type Pong
- type ProfileAlignment
- type ProfileBorderCurve
- type Ready
- type Reply
- type RevoltBot
- func (rb *RevoltBot) FetchUser(userID string) (user *User, err error)
- func (rb *RevoltBot) Get(path string) (resp *http.Response, err error)
- func (rb *RevoltBot) Heartbeat()
- func (rb *RevoltBot) OnAuthenticated(o Authenticated)
- func (rb *RevoltBot) OnChannelAck(o ChannelAck)
- func (rb *RevoltBot) OnChannelCreate(o ChannelCreate)
- func (rb *RevoltBot) OnChannelDelete(o ChannelDelete)
- func (rb *RevoltBot) OnChannelGroupJoin(o ChannelGroupJoin)
- func (rb *RevoltBot) OnChannelGroupLeave(o ChannelGroupLeave)
- func (rb *RevoltBot) OnChannelStartTyping(o ChannelStartTyping)
- func (rb *RevoltBot) OnChannelStopTyping(o ChannelStopTyping)
- func (rb *RevoltBot) OnChannelUpdate(o ChannelUpdate)
- func (rb *RevoltBot) OnDispatch(messageType string, data []byte) (err error)
- func (rb *RevoltBot) OnMessageCreate(o MessageCreate)
- func (rb *RevoltBot) OnMessageDelete(o MessageDelete)
- func (rb *RevoltBot) OnMessageUpdate(o MessageUpdate)
- func (rb *RevoltBot) OnPong(o Pong)
- func (rb *RevoltBot) OnReady(o Ready)
- func (rb *RevoltBot) OnServerDelete(o ServerDelete)
- func (rb *RevoltBot) OnServerMemberJoin(o ServerMemberJoin)
- func (rb *RevoltBot) OnServerMemberLeave(o ServerMemberLeave)
- func (rb *RevoltBot) OnServerMemberUpdate(o ServerMemberUpdate)
- func (rb *RevoltBot) OnServerRoleDelete(o ServerRoleDelete)
- func (rb *RevoltBot) OnServerRoleUpdate(o ServerRoleUpdate)
- func (rb *RevoltBot) OnServerUpdate(o ServerUpdate)
- func (rb *RevoltBot) OnUserRelationship(o UserRelationship)
- func (rb *RevoltBot) OnUserUpdate(o UserUpdate)
- func (rb *RevoltBot) Post(path string, data interface{}) (resp *http.Response, err error)
- func (rb *RevoltBot) SendEvent(data interface{}) (err error)
- func (rb *RevoltBot) SendMessage(channelID string, messageRequest *MessageRequest) (message *Message, err error)
- func (rb *RevoltBot) Start() (err error)
- func (rb *RevoltBot) UploadFile(fileName string, fileContent []byte) (autumnID string, err error)
- type SentBase
- type ServerDelete
- type ServerMemberJoin
- type ServerMemberLeave
- type ServerMemberUpdate
- type ServerRoleDelete
- type ServerRoleUpdate
- type ServerUpdate
- type Theme
- type User
- type UserBot
- type UserRelations
- type UserRelationship
- type UserStatus
- type UserUpdate
- type Xalignment
- type Yalignment
Constants ¶
View Source
const AutumnHTTPBase = "https://autumn.revolt.chat"
View Source
const RevoltHTTPBase = "https://api.revolt.chat"
View Source
const RevoltWS = "wss://ws.revolt.chat?format=json"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Authenticate ¶
type Authenticated ¶
type Authenticated struct {
SentBase
}
type BeginTyping ¶
type ChannelAck ¶
type ChannelCreate ¶
type ChannelDelete ¶
type ChannelGroupJoin ¶
type ChannelGroupLeave ¶
type ChannelStartTyping ¶
type ChannelStopTyping ¶
type ChannelUpdate ¶
type Guild ¶
type Guild struct {
ID string `json:"_id"`
Nonce string `json:"nonce"`
Owner string `json:"owner"`
Name string `json:"name"`
Description string
Channels []string `json:"channels"`
Categories []*GuildCategory `json:"categories"`
Roles []*GuildRole `json:"roles"`
SystemMessages *GuildSystemMessages `json:"system_messages"`
DefaultPermissions []int `json:"default_permissions"`
Icon *File `json:"icon"`
Banner *File `json:"banner"`
}
type GuildCategory ¶
type GuildMember ¶
type GuildMember struct {
ID *GuildMemberIDs `json:"_id"`
}
type GuildMemberIDs ¶
type GuildSystemMessages ¶
type ImageCreateArguments ¶
type ImageOpts ¶
type ImageOpts struct {
// Newline split message
Text string `json:"text"`
GuildId int64 `json:"guild_id"`
ImageURL string `json:"image_url"`
UserId int64 `json:"user_id"`
Avatar string `json:"avatar"`
AllowGIF bool `json:"allow_gif"`
// Which theme to use when generating images
Theme Theme `json:"layout"`
// Identifier for background
Background string `json:"background"`
// Identifier for font to use (along with Noto)
Font string `json:"font"`
// Border applied to entire image. If transparent, there is no border.
BorderColour color.RGBA `json:"-"`
BorderColourHex string `json:"border_colour"`
BorderWidth int `json:"border_width"`
// Alignment of left or right (assuming not vertical layout)
ProfileAlignment ProfileAlignment `json:"profile_alignment"`
// Text alignment (left, center, right) (top, middle, bottom)
TextAlignmentX Xalignment `json:"text_alignment_x"`
TextAlignmentY Yalignment `json:"text_alignment_y"`
// Include a border around profile pictures. This also fills
// under the profile.
ProfileBorderColour color.RGBA `json:"-"`
ProfileBorderColourHex string `json:"profile_border_colour"`
// Padding applied to profile pictures inside profile border
ProfileBorderWidth int `json:"profile_border_width"`
// Type of curving on the profile border (circle, rounded, square)
ProfileBorderCurve ProfileBorderCurve `json:"profile_border_curve"`
// Text stroke. If 0, there is no stroke
TextStroke int `json:"text_stroke"`
TextStrokeColour color.RGBA `json:"-"`
TextStrokeColourHex string `json:"text_stroke_colour"`
TextColour color.RGBA `json:"-"`
TextColourHex string `json:"text_colour"`
}
type Message ¶
type Message struct {
ID string `json:"_id"`
Nonce string `json:"nonce"`
ChannelID string `json:"channel"`
Author string `json:"author"`
Content string `json:"-"`
TargetID string `json:"-"`
By string `json:"-"`
Name string `json:"-"`
ContentType string `json:"-"`
RawContent interface{} `json:"content"`
Attachments []*File `json:"attachments"`
Edited int `json:"edited"`
Mentions []string `json:"mentions"`
Replies []string `json:"replies"`
}
type MessageContent ¶
type MessageContent struct {
Type string `json:"type"`
// text
Content *string `json:"content,omitempty"`
// system messages
ID *string `json:"id,omitempty"`
// system messages/channel_description_changed/channel_icon_changed
By *string `json:"by,omitempty"`
// channel_renamed
Name *string `json:"name,omitempty"`
}
type MessageCreate ¶
type MessageDelete ¶
type MessageRequest ¶
type MessageUpdate ¶
type ProfileAlignment ¶
type ProfileAlignment uint8
const ( FloatLeft ProfileAlignment = iota FloatRight )
type ProfileBorderCurve ¶
type ProfileBorderCurve uint8
const ( CurveCircle ProfileBorderCurve = iota CurveSoft CurveSquare )
type Ready ¶
type Ready struct {
SentBase
Users []*User `json:"users"`
Guilds []*Guild `json:"servers"`
Channels []*Channel `json:"channels"`
Members []*GuildMember `json:"members"`
}
type RevoltBot ¶
type RevoltBot struct {
Token string
Users map[string]*User
Guilds map[string]*Guild
Channels map[string]*Channel
Members map[string]*GuildMember
// contains filtered or unexported fields
}
func NewRevoltBot ¶
func (*RevoltBot) OnAuthenticated ¶
func (rb *RevoltBot) OnAuthenticated(o Authenticated)
func (*RevoltBot) OnChannelAck ¶
func (rb *RevoltBot) OnChannelAck(o ChannelAck)
func (*RevoltBot) OnChannelCreate ¶
func (rb *RevoltBot) OnChannelCreate(o ChannelCreate)
func (*RevoltBot) OnChannelDelete ¶
func (rb *RevoltBot) OnChannelDelete(o ChannelDelete)
func (*RevoltBot) OnChannelGroupJoin ¶
func (rb *RevoltBot) OnChannelGroupJoin(o ChannelGroupJoin)
func (*RevoltBot) OnChannelGroupLeave ¶
func (rb *RevoltBot) OnChannelGroupLeave(o ChannelGroupLeave)
func (*RevoltBot) OnChannelStartTyping ¶
func (rb *RevoltBot) OnChannelStartTyping(o ChannelStartTyping)
func (*RevoltBot) OnChannelStopTyping ¶
func (rb *RevoltBot) OnChannelStopTyping(o ChannelStopTyping)
func (*RevoltBot) OnChannelUpdate ¶
func (rb *RevoltBot) OnChannelUpdate(o ChannelUpdate)
func (*RevoltBot) OnDispatch ¶
func (*RevoltBot) OnMessageCreate ¶
func (rb *RevoltBot) OnMessageCreate(o MessageCreate)
func (*RevoltBot) OnMessageDelete ¶
func (rb *RevoltBot) OnMessageDelete(o MessageDelete)
func (*RevoltBot) OnMessageUpdate ¶
func (rb *RevoltBot) OnMessageUpdate(o MessageUpdate)
func (*RevoltBot) OnServerDelete ¶
func (rb *RevoltBot) OnServerDelete(o ServerDelete)
func (*RevoltBot) OnServerMemberJoin ¶
func (rb *RevoltBot) OnServerMemberJoin(o ServerMemberJoin)
func (*RevoltBot) OnServerMemberLeave ¶
func (rb *RevoltBot) OnServerMemberLeave(o ServerMemberLeave)
func (*RevoltBot) OnServerMemberUpdate ¶
func (rb *RevoltBot) OnServerMemberUpdate(o ServerMemberUpdate)
func (*RevoltBot) OnServerRoleDelete ¶
func (rb *RevoltBot) OnServerRoleDelete(o ServerRoleDelete)
func (*RevoltBot) OnServerRoleUpdate ¶
func (rb *RevoltBot) OnServerRoleUpdate(o ServerRoleUpdate)
func (*RevoltBot) OnServerUpdate ¶
func (rb *RevoltBot) OnServerUpdate(o ServerUpdate)
func (*RevoltBot) OnUserRelationship ¶
func (rb *RevoltBot) OnUserRelationship(o UserRelationship)
func (*RevoltBot) OnUserUpdate ¶
func (rb *RevoltBot) OnUserUpdate(o UserUpdate)
func (*RevoltBot) SendMessage ¶
func (rb *RevoltBot) SendMessage(channelID string, messageRequest *MessageRequest) (message *Message, err error)
type ServerDelete ¶
type ServerMemberJoin ¶
type ServerMemberLeave ¶
type ServerMemberUpdate ¶
type ServerMemberUpdate struct {
SentBase
GuildID string `json:"id"`
Member *GuildMember `json:"data"`
Clear string `json:"clear"`
}
type ServerRoleDelete ¶
type ServerRoleUpdate ¶
type ServerUpdate ¶
type User ¶
type User struct {
ID string `json:"_id"`
Username string `json:"username"`
Avatar *File `json:"avatar"`
Relations []*UserRelations `json:"relations"`
Badges int `json:"badges"`
Status *UserStatus `json:"status"`
Bot *UserBot `json:"bot,omitempty"`
Relationship string `json:"relationship"`
Online bool `json:"online"`
Flags int `json:"flags"`
}
type UserRelations ¶
type UserRelationship ¶
type UserStatus ¶
type UserUpdate ¶
type Xalignment ¶
type Xalignment uint8
const ( AlignLeft Xalignment = iota AlignMiddle AlignRight )
type Yalignment ¶
type Yalignment uint8
const ( AlignTop Yalignment = iota AlignCenter AlignBottom )
Click to show internal directories.
Click to hide internal directories.