Documentation
¶
Index ¶
- type Attachment
- type AttachmentMetadata
- type Binary
- type Bot
- type BotInformation
- type Cache
- func (c *Cache) GetChannel(id string) *Channel
- func (c *Cache) GetMember(id string) *Member
- func (c *Cache) GetServer(id string) *Server
- func (c *Cache) GetUser(id string) *User
- func (c *Cache) RemoveChannel(id string) error
- func (c *Cache) RemoveMember(id string) error
- func (c *Cache) RemoveServer(id string) error
- func (c *Cache) RemoveUser(id string) error
- type Channel
- type Client
- func (c Client) AddFriend(ctx context.Context, username string) (*UserRelations, error)
- func (c *Client) AddGroupRecipient(ctx context.Context, groupID, userID string) error
- func (c *Client) Auth(ctx context.Context, friendlyName string) error
- func (c *Client) BotDelete(ctx context.Context, id string) error
- func (c *Client) BotEdit(ctx context.Context, id string, eb *EditBot) error
- func (c *Client) ChannelCreateInvite(ctx context.Context, channelID string) (string, error)
- func (c *Client) ChannelDelete(ctx context.Context, channelID string) error
- func (c *Client) ChannelEdit(ctx context.Context, channelID string, ec *EditChannel) error
- func (c *Client) ChannelFetchMessage(ctx context.Context, channelID, id string) (*Message, error)
- func (c *Client) ChannelFetchMessages(ctx context.Context, channelID string, options url.Values) (*FetchedMessages, error)
- func (c *Client) ChannelSendMessage(ctx context.Context, channelID string, message *SendMessage) (*Message, error)
- func (c *Client) ChannelSetPermissions(ctx context.Context, channelID, roleID string, permissions uint) error
- func (c *Client) Connect(ctx context.Context, handler Handler)
- func (c *Client) CreateBot(ctx context.Context, name string) (*Bot, error)
- func (c *Client) CreateEmoji(ctx context.Context, uploadID string, emoji CreateEmoji) (*Emoji, error)
- func (c *Client) CreateGroup(ctx context.Context, name, description string, users []string) (*Channel, error)
- func (c *Client) CreateServer(ctx context.Context, name, description string) (*Server, error)
- func (c *Client) CreateTextChannel(ctx context.Context, serverID, name, description string) (*Channel, error)
- func (c *Client) CreateVoiceChannel(ctx context.Context, serverID, name, description string) (*Channel, error)
- func (c *Client) DeleteEmoji(ctx context.Context, id string) error
- func (c *Client) DeleteGroupRecipient(ctx context.Context, groupID, userID string) error
- func (c Client) Edit(ctx context.Context, eu *EditUser) error
- func (c *Client) Emoji(ctx context.Context, id string) (*Emoji, error)
- func (c *Client) FetchBot(ctx context.Context, id string) (*Bot, error)
- func (c *Client) FetchBots(ctx context.Context) (*FetchedBots, error)
- func (c *Client) FetchChannel(ctx context.Context, id string) (*Channel, error)
- func (c *Client) FetchDirectMessages(ctx context.Context) ([]*Channel, error)
- func (c Client) FetchRelationships(ctx context.Context) ([]*UserRelations, error)
- func (c *Client) FetchServer(ctx context.Context, id string) (*Server, error)
- func (c *Client) FetchUser(ctx context.Context, id string) (*User, error)
- func (c *Client) GroupFetchMembers(ctx context.Context, groupID string) ([]*User, error)
- func (c *Client) MarkServerAsRead(ctx context.Context, id string) error
- func (c *Client) MessageDelete(ctx context.Context, channelID, messageID string) error
- func (c *Client) MessageEdit(ctx context.Context, channelID, messageID, content string) error
- func (c *Client) MessageReply(ctx context.Context, channelID, messageID string, mention bool, ...) (*Message, error)
- func (c Client) RemoveFriend(ctx context.Context, username string) (*UserRelations, error)
- func (c Client) Request(ctx context.Context, method, path string, data []byte) ([]byte, error)
- func (c *Client) RequestWithPathAndContentType(ctx context.Context, method, path, contentType string, data []byte) ([]byte, error)
- func (c *Client) ResolveAttachment(att *Attachment) string
- func (c *Client) ServerBanMember(ctx context.Context, serverID, id, reason string) error
- func (c *Client) ServerCreateRole(ctx context.Context, serverID, name string) (string, error)
- func (c *Client) ServerDelete(ctx context.Context, serverID string) error
- func (c *Client) ServerDeleteRole(ctx context.Context, serverID, id string) error
- func (c *Client) ServerEdit(ctx context.Context, serverID string, es *EditServer) error
- func (c *Client) ServerEditMember(ctx context.Context, serverID, id string, em *EditMember) error
- func (c *Client) ServerEditRole(ctx context.Context, serverID, id string, er *EditRole) error
- func (c *Client) ServerFetchBans(ctx context.Context, serverID string) (*FetchedBans, error)
- func (c *Client) ServerFetchInvites(ctx context.Context, serverID string) error
- func (c *Client) ServerFetchMember(ctx context.Context, serverID, id string) (*Member, error)
- func (c *Client) ServerFetchMembers(ctx context.Context, serverID string) (*FetchedMembers, error)
- func (c *Client) ServerKickMember(ctx context.Context, serverID, id string) error
- func (c *Client) ServerSetRolePermissions(ctx context.Context, serverID, roleID string, ...) error
- func (c *Client) ServerTimeoutMember(ctx context.Context, serverID, id string) error
- func (c *Client) ServerUnbanMember(ctx context.Context, serverID, id string) error
- func (c *Client) Upload(ctx context.Context, tag, fname string, data []byte) (string, error)
- func (c *Client) UserBlock(ctx context.Context, uid string) (*UserRelations, error)
- func (c *Client) UserFetchDefaultAvatar(ctx context.Context, uid string) (*Binary, error)
- func (c *Client) UserFetchRelationship(ctx context.Context, uid string) (*UserRelations, error)
- func (c *Client) UserOpenDirectMessage(ctx context.Context, uid string) (*Channel, error)
- func (c *Client) UserUnblock(ctx context.Context, uid string) (*UserRelations, error)
- type CreateEmoji
- type EditBot
- type EditChannel
- type EditMember
- type EditRole
- type EditServer
- func (es *EditServer) AddCategory(category *ServerCategory) *EditServer
- func (es *EditServer) RemoveItem(item string) *EditServer
- func (es *EditServer) SetBanner(autumn_id string) *EditServer
- func (es *EditServer) SetDescription(desc string) *EditServer
- func (es *EditServer) SetIcon(autumn_id string) *EditServer
- func (es *EditServer) SetName(name string) *EditServer
- func (es *EditServer) SetSystemMessages(sm *ServerSystemMessages) *EditServer
- type EditUser
- type Emoji
- type Events
- type FetchedBans
- type FetchedBots
- type FetchedGroupMembers
- type FetchedMembers
- type FetchedMessages
- type Group
- type GroupSystemMessages
- type Handler
- type Interaction
- type Masquerade
- type Member
- type Message
- type MessageAppend
- type MessageEdited
- type MessageEmbed
- type MessageEmbeddedImage
- type MessageEmbeddedVideo
- type MessageSpecialEmbed
- type NullHandler
- func (NullHandler) Authenticated(context.Context) error
- func (NullHandler) ChannelAck(context.Context, string, string, string) error
- func (NullHandler) ChannelCreate(context.Context, *Channel) error
- func (NullHandler) ChannelDelete(context.Context, string) error
- func (NullHandler) ChannelGroupJoin(context.Context, string, string) error
- func (NullHandler) ChannelGroupLeave(context.Context, string, string) error
- func (NullHandler) ChannelStartTyping(context.Context, string, string) error
- func (NullHandler) ChannelStopTyping(context.Context, string, string) error
- func (NullHandler) ChannelUpdate(context.Context, string, *Channel, []string) error
- func (NullHandler) EmojiCreate(context.Context, *Emoji) error
- func (NullHandler) EmojiDelete(context.Context, string) error
- func (NullHandler) MessageAppend(context.Context, string, string, *MessageAppend) error
- func (NullHandler) MessageCreate(context.Context, *Message) error
- func (NullHandler) MessageDelete(context.Context, string, string) error
- func (NullHandler) MessageReact(context.Context, string, string, string, string) error
- func (NullHandler) MessageRemoveReaction(context.Context, string, string, string) error
- func (NullHandler) MessageUnreact(context.Context, string, string, string, string) error
- func (NullHandler) MessageUpdate(context.Context, string, string, *Message) error
- func (NullHandler) Ready(context.Context) error
- func (NullHandler) ServerChannelCreate(context.Context, string, *Channel) error
- func (NullHandler) ServerChannelDelete(context.Context, string, string) error
- func (NullHandler) ServerChannelUpdate(context.Context, string, string, *Channel, []string) error
- func (NullHandler) ServerCreate(context.Context, *Server) error
- func (NullHandler) ServerDelete(context.Context, string) error
- func (NullHandler) ServerMemberJoin(context.Context, string, string) error
- func (NullHandler) ServerMemberLeave(context.Context, string, string) error
- func (NullHandler) ServerMemberUpdate(context.Context, string, string, *Member, []string) error
- func (NullHandler) ServerRoleCreate(context.Context, string, *Role) error
- func (NullHandler) ServerRoleDelete(context.Context, string, string) error
- func (NullHandler) ServerRoleUpdate(context.Context, string, string, *Role, []string) error
- func (NullHandler) ServerUpdate(context.Context, string, *Server, []string) error
- func (NullHandler) UnknownEvent(context.Context, string, []byte) error
- func (NullHandler) UserPlatformWipe(context.Context, string, string) error
- func (NullHandler) UserRelationship(context.Context, string, *User, string) error
- func (NullHandler) UserUpdate(context.Context, string, *User, []string) error
- type Parent
- type Permissions
- func (p *Permissions) Add(perms ...string) *Permissions
- func (p Permissions) Calculate(perms ...string) uint
- func (p Permissions) Has(perm string) bool
- func (p *Permissions) InitChannel() *Permissions
- func (p *Permissions) InitServer() *Permissions
- func (p *Permissions) InitUser() *Permissions
- func (p *Permissions) Remove(perms ...string) *Permissions
- type Replies
- type RevoltAutumn
- type RevoltBuild
- type RevoltCaptcha
- type RevoltFeatures
- type RevoltJanuary
- type RevoltSettings
- type RevoltVoso
- type Role
- type SelfBot
- type SendMessage
- func (sms *SendMessage) AddAttachment(attachment string) *SendMessage
- func (sms *SendMessage) AddReply(id string, mention bool) *SendMessage
- func (sms *SendMessage) CreateNonce() *SendMessage
- func (sms *SendMessage) SetContent(content string) *SendMessage
- func (sms *SendMessage) SetContentf(format string, values ...interface{}) *SendMessage
- func (sms *SendMessage) SetDeleteAfter(second uint) *SendMessage
- type SendableEmbed
- type Server
- type ServerCategory
- type ServerSystemMessages
- type User
- type UserRelations
- type UserStatus
- type WSError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attachment ¶
type Attachment struct { ID string `json:"_id"` Tag string `json:"tag"` Size int `json:"size"` FileName string `json:"filename"` Metadata *AttachmentMetadata ContentType string `json:"content_type"` }
Attachment struct.
type AttachmentMetadata ¶
type AttachmentMetadata struct { Type string `json:"type"` Width int `json:"width"` Height int `json:"height"` }
Attachment metadata struct.
type Bot ¶
type Bot struct { CreatedAt time.Time Id string `json:"_id"` OwnerId string `json:"owner"` Token string `json:"token"` IsPublic bool `json:"public"` InteractionsUrl string `json:"interactionsURL"` }
Bot struct.
func (*Bot) CalculateCreationDate ¶
Calculate creation date and edit the struct.
type BotInformation ¶
type BotInformation struct {
Owner string `json:"owner"`
}
Bot information struct.
type Cache ¶
type Cache struct { Users []*User `json:"users"` Servers []*Server `json:"servers"` Channels []*Channel `json:"channels"` Members []*Member `json:"members"` }
Client cache struct.
func (*Cache) GetChannel ¶
Get a channel from cache by Id. Will return an empty channel struct if not found.
func (*Cache) GetMember ¶
Get a member from cache by Id. Will return an empty member struct if not found.
func (*Cache) GetServer ¶
Get a server from cache by Id. Will return an empty server struct if not found.
func (*Cache) GetUser ¶
Get an user from cache by Id. Will return an empty user struct if not found.
func (*Cache) RemoveChannel ¶
Remove a channel from cache by Id. Will not delete the channel, just deletes the channel from cache. Will change the entire channel cache order!
func (*Cache) RemoveMember ¶
Remove a member from cache by Id. Will not delete the member, just deletes the member from cache. Will change the entire member cache order!
func (*Cache) RemoveServer ¶
Remove a server from cache by Id. Will not delete the server, just deletes the server from cache. Will change the entire server cache order!
func (*Cache) RemoveUser ¶
Remove an user from cache by Id. Will not delete the user, just deletes the user from cache. Will change the entire user cache order!
type Channel ¶
type Channel struct { CreatedAt time.Time Id string `json:"_id"` Nonce string `json:"nonce"` OwnerId string `json:"owner"` Name string `json:"name"` Active bool `json:"active"` Recipients []string `json:"recipients"` LastMessage interface{} `json:"last_message"` Description string `json:"description"` Icon *Attachment `json:"icon"` DefaultPermissions interface{} `json:"default_permissions"` RolePermissions interface{} `json:"role_permissions"` Permissions uint `json:"permissions"` }
Channel struct.
func (*Channel) CalculateCreationDate ¶
Calculate creation date and edit the struct.
type Client ¶
type Client struct { SelfBot *SelfBot Token string Socket gowebsocket.Socket HTTP *http.Client Cache *Cache BaseURL string WSURL string Ticker *time.Ticker Settings RevoltSettings }
Client struct.
func New ¶
New creates a new client with the default Revolt server details.
Use NewWithEndpoint to create a client with a custom endpoint.
func NewWithEndpoint ¶
NewWithEndpoint creates a new client with a custom Revolt endpoint.
You can use this to test the library against an arbirtary Revolt server.
func (Client) AddFriend ¶
Send friend request. / Accept friend request. User relations struct only will have status. id is not defined for this function.
func (*Client) AddGroupRecipient ¶
Add a new group recipient.
func (*Client) ChannelCreateInvite ¶
Create a new invite. Returns a string (invite code) and error (nil if not exists).
func (*Client) ChannelDelete ¶
Delete channel.
func (*Client) ChannelEdit ¶
Edit channel.
func (*Client) ChannelFetchMessage ¶
Fetch a message from channel by Id.
func (*Client) ChannelFetchMessages ¶
func (c *Client) ChannelFetchMessages(ctx context.Context, channelID string, options url.Values) (*FetchedMessages, error)
Fetch messages from channel. Check: https://developers.revolt.chat/api/#tag/Messaging/paths/~1channels~1:channel~1messages/get for map parameters.
func (*Client) ChannelSendMessage ¶
func (c *Client) ChannelSendMessage(ctx context.Context, channelID string, message *SendMessage) (*Message, error)
SendMessage sends a message to a channel.
func (*Client) ChannelSetPermissions ¶
func (c *Client) ChannelSetPermissions(ctx context.Context, channelID, roleID string, permissions uint) error
Set channel permissions for a role. Leave role field empty if you want to edit default permissions
func (*Client) CreateEmoji ¶
func (c *Client) CreateEmoji(ctx context.Context, uploadID string, emoji CreateEmoji) (*Emoji, error)
CreateEmoji creates a new emoji.
func (*Client) CreateGroup ¶
func (c *Client) CreateGroup(ctx context.Context, name, description string, users []string) (*Channel, error)
Create a new group. Users parameter is a list of users will be added.
func (*Client) CreateServer ¶
Create a server.
func (*Client) CreateTextChannel ¶
func (c *Client) CreateTextChannel(ctx context.Context, serverID, name, description string) (*Channel, error)
Create a new text-channel.
func (*Client) CreateVoiceChannel ¶
func (c *Client) CreateVoiceChannel(ctx context.Context, serverID, name, description string) (*Channel, error)
Create a new voice-channel.
func (*Client) DeleteEmoji ¶
DeleteEmoji deletes an emoji.
func (*Client) DeleteGroupRecipient ¶
Delete a group recipient.
func (*Client) FetchBots ¶
func (c *Client) FetchBots(ctx context.Context) (*FetchedBots, error)
Fetch client bots.
func (*Client) FetchChannel ¶
Fetch a channel by Id.
func (*Client) FetchDirectMessages ¶
Fetch all of the DMs.
func (Client) FetchRelationships ¶
func (c Client) FetchRelationships(ctx context.Context) ([]*UserRelations, error)
Fetch relationships.
func (*Client) FetchServer ¶
Fetch a server by Id.
func (*Client) GroupFetchMembers ¶
Fetch all of the members from group.
func (*Client) MarkServerAsRead ¶
Mark a server as read.
func (*Client) MessageDelete ¶
Delete the message.
func (*Client) MessageEdit ¶
Edit message content.
func (*Client) MessageReply ¶
func (c *Client) MessageReply(ctx context.Context, channelID, messageID string, mention bool, sm *SendMessage) (*Message, error)
Reply to the message.
func (Client) RemoveFriend ¶
Deny friend request. / Remove friend. User relations struct only will have status. id is not defined for this function.
func (*Client) RequestWithPathAndContentType ¶
func (*Client) ResolveAttachment ¶ added in v1.6.0
func (c *Client) ResolveAttachment(att *Attachment) string
func (*Client) ServerBanMember ¶
Ban a member from server.
func (*Client) ServerCreateRole ¶
Create a new role for server. Returns string (role id) and error.
func (*Client) ServerDelete ¶
Delete / leave server. If the server not created by client, it will leave. Otherwise it will be deleted.
func (*Client) ServerDeleteRole ¶
Delete a server role.
func (*Client) ServerEdit ¶
Edit server.
func (*Client) ServerEditMember ¶
Edit a member.
func (*Client) ServerEditRole ¶
Edit a server role.
func (*Client) ServerFetchBans ¶
Fetch server bans.
func (*Client) ServerFetchInvites ¶
Fetch server invite.
func (*Client) ServerFetchMember ¶
Fetch a member from Server.
func (*Client) ServerFetchMembers ¶
Fetch all of the members from Server.
func (*Client) ServerKickMember ¶
Kick a member from server.
func (*Client) ServerSetRolePermissions ¶
func (c *Client) ServerSetRolePermissions(ctx context.Context, serverID, roleID string, channelPermissions, serverPermissions uint) error
Set server permissions for a role. Leave role field empty if you want to edit default permissions
func (*Client) ServerTimeoutMember ¶
Timeout a member from server. Placeholder.
func (*Client) ServerUnbanMember ¶
Unban a member from server.
func (*Client) UserFetchDefaultAvatar ¶
Fetch default user avatar.
func (*Client) UserFetchRelationship ¶
Fetch user relationship.
func (*Client) UserOpenDirectMessage ¶
Open a DM with the user.
func (*Client) UserUnblock ¶
Un-block user.
type CreateEmoji ¶
type EditBot ¶
type EditBot struct { Name string `json:"name,omitempty"` Public bool `json:"public,omitempty"` InteractionsUrl string `json:"interactionsURL,omitempty"` Remove string `json:"remove,omitempty"` }
Edit bot struct Please see https://developers.revolt.chat/api/#tag/Bots/paths/~1bots~1:bot/patch for more information.
func (*EditBot) RemoveInteractionsUrl ¶
Remove interaction url for struct.
func (*EditBot) SetInteractionsUrl ¶
Set interaction url for struct.
func (*EditBot) SetPublicValue ¶
Set public value for struct.
type EditChannel ¶
type EditChannel struct { Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` Icon string `json:"icon,omitempty"` Remove string `json:"remove,omitempty"` }
Edit channel struct. Please see: https://developers.revolt.chat/api/#tag/Channel-Information/paths/~1channels~1:channel/patch for more information.
func (*EditChannel) RemoveItem ¶
func (ec *EditChannel) RemoveItem(item string) *EditChannel
Set remove item.
func (*EditChannel) SetDescription ¶
func (ec *EditChannel) SetDescription(desc string) *EditChannel
Set description for struct.
func (*EditChannel) SetIcon ¶
func (ec *EditChannel) SetIcon(autumn_id string) *EditChannel
Set icon for struct.
func (*EditChannel) SetName ¶
func (ec *EditChannel) SetName(name string) *EditChannel
Set name for struct.
type EditMember ¶
type EditMember struct { Nickname string `json:"nickname,omitempty"` Avatar string `json:"avatar,omitempty"` Roles []string `json:"roles,omitempty"` Remove string `json:"remove,omitempty"` }
Edit member struct. Please see https://developers.revolt.chat/api/#tag/Server-Members/paths/~1servers~1:server~1members~1:member/patch for more information.
func (*EditMember) AddRole ¶
func (em *EditMember) AddRole(role_id string) *EditMember
Add role for struct.
func (*EditMember) RemoveItem ¶
func (em *EditMember) RemoveItem(item string) *EditMember
Set remove item.
func (*EditMember) SetAvatar ¶
func (em *EditMember) SetAvatar(autumn_id string) *EditMember
Set avatar for struct.
func (*EditMember) SetNickname ¶
func (em *EditMember) SetNickname(nick string) *EditMember
Set nickname for struct.
type EditRole ¶
type EditRole struct { Name string `json:"name,omitempty"` Color string `json:"colour,omitempty"` Hoist bool `json:"hoist,omitempty"` Rank int `json:"rank,omitempty"` Remove string `json:"remove,omitempty"` }
Edit role struct.
func (*EditRole) RemoveColour ¶
Set role ranking for struct.
type EditServer ¶
type EditServer struct { Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` Icon string `json:"icon,omitempty"` Banner string `json:"banner,omitempty"` Categories []*ServerCategory `json:"categories,omitempty"` SystemMessages *ServerSystemMessages `json:"system_messages,omitempty"` Remove string `json:"remove,omitempty"` }
Edit server struct. Please see https://developers.revolt.chat/api/#tag/Server-Information/paths/~1servers~1:server/patch for more detail.
func (*EditServer) AddCategory ¶
func (es *EditServer) AddCategory(category *ServerCategory) *EditServer
Add a new category for struct.
func (*EditServer) RemoveItem ¶
func (es *EditServer) RemoveItem(item string) *EditServer
Set remove item.
func (*EditServer) SetBanner ¶
func (es *EditServer) SetBanner(autumn_id string) *EditServer
Set banner for struct.
func (*EditServer) SetDescription ¶
func (es *EditServer) SetDescription(desc string) *EditServer
Set description for struct.
func (*EditServer) SetIcon ¶
func (es *EditServer) SetIcon(autumn_id string) *EditServer
Set icon for struct.
func (*EditServer) SetName ¶
func (es *EditServer) SetName(name string) *EditServer
Set name for struct
func (*EditServer) SetSystemMessages ¶
func (es *EditServer) SetSystemMessages(sm *ServerSystemMessages) *EditServer
Set system messages for struct.
type EditUser ¶
type EditUser struct { Status struct { Text string `json:"text,omitempty"` Presence string `json:"presence,omitempty"` } `json:"status,omitempty"` Profile struct { Content string `json:"content,omitempty"` Background string `json:"background,omitempty"` } `json:"profile,omitempty"` Avatar string `json:"avatar,omitempty"` Remove string `json:"remove,omitempty"` }
Edit client user struct. See https://developers.revolt.chat/api/#tag/User-Information/paths/~1users~1@me/patch for more information.
func (*EditUser) SetProfile ¶
Set profile informations for struct.
type Emoji ¶
type Emoji struct { ID string `json:"_id"` Name string `json:"name"` Animated bool `json:"animated"` NSFW bool `json:"nsfw"` CreatorID string `json:"creator_id"` URL string `json:"url"` }
Emoji struct.
type FetchedBans ¶
type FetchedBans struct { Users []*User `json:"users"` Bans []struct { Ids struct { UserId string `json:"user"` ServerUd string `json:"server"` } `json:"_id"` Reason string `json:"reason"` } `json:"bans"` }
Fetched bans struct.
type FetchedBots ¶
Fetched bots struct.
type FetchedGroupMembers ¶
type FetchedGroupMembers struct { Messages []*Message `json:"messages"` Users []*User `json:"users"` }
Fetched group members struct.
type FetchedMembers ¶
Fetched server members struct.
type FetchedMessages ¶
Fetched messages struct.
type Group ¶
type Group struct { CreatedAt time.Time Id string `json:"_id"` Nonce string `json:"nonce"` OwnerId string `json:"owner"` Name string `json:"name"` Description string `json:"description,omitempty"` Users []string `json:"users"` }
Group channel struct.
func (*Group) CalculateCreationDate ¶
Calculate creation date and edit the struct.
type GroupSystemMessages ¶
type GroupSystemMessages struct { UserJoined string `json:"user_joined,omitempty"` UserLeft string `json:"user_left,omitempty"` }
System messages struct.
type Handler ¶
type Handler interface { UnknownEvent(ctx context.Context, kind string, data []byte) error Authenticated(context.Context) error Ready(context.Context) error MessageCreate(ctx context.Context, message *Message) error MessageAppend(ctx context.Context, channelID, messageID string, data *MessageAppend) error MessageDelete(ctx context.Context, channelID, messageID string) error MessageUpdate(ctx context.Context, channelID, messageID string, data *Message) error MessageReact(ctx context.Context, messageID, channelID, userID, emojiID string) error MessageUnreact(ctx context.Context, messageID, channelID, userID, emojiID string) error MessageRemoveReaction(ctx context.Context, messageID, channelID, emojiID string) error ChannelCreate(ctx context.Context, channel *Channel) error ChannelUpdate(ctx context.Context, channelID string, channel *Channel, clear []string) error ChannelDelete(ctx context.Context, channelID string) error ChannelAck(ctx context.Context, channelID, userID, messageID string) error ChannelStartTyping(ctx context.Context, channelID, userID string) error ChannelStopTyping(ctx context.Context, channelID, userID string) error ChannelGroupJoin(ctx context.Context, channelID, userID string) error ChannelGroupLeave(ctx context.Context, channelID, userID string) error ServerCreate(ctx context.Context, srv *Server) error ServerUpdate(ctx context.Context, serverID string, srv *Server, clear []string) error ServerDelete(ctx context.Context, serverID string) error ServerMemberUpdate(ctx context.Context, serverID, userID string, data *Member, clear []string) error ServerMemberJoin(ctx context.Context, serverID, userID string) error ServerMemberLeave(ctx context.Context, serverID, userID string) error ServerRoleUpdate(ctx context.Context, serverID, roleID string, role *Role, clear []string) error ServerRoleDelete(ctx context.Context, serverID, roleID string) error // Users UserUpdate(ctx context.Context, userID string, user *User, clear []string) error UserRelationship(ctx context.Context, userID string, user *User, status string) error UserPlatformWipe(ctx context.Context, userID string, flags string) error // Emoji EmojiCreate(ctx context.Context, emoji *Emoji) error EmojiDelete(ctx context.Context, emojiID string) error }
type Masquerade ¶
type Member ¶
type Member struct { Informations struct { ServerId string `json:"server"` UserId string `json:"user"` } `json:"_id"` Nickname string `json:"nickname"` Avatar *Attachment `json:"avatar"` Roles []string `json:"roles"` }
Server member struct.
type Message ¶
type Message struct { CreatedAt time.Time ID string `json:"_id"` Nonce string `json:"nonce"` ChannelId string `json:"channel"` AuthorId string `json:"author"` Content string `json:"content,omitempty"` Edited interface{} `json:"edited"` Embeds []*MessageEmbed `json:"embeds"` Attachments []*Attachment `json:"attachments"` Mentions []string `json:"mentions"` Replies []string `json:"replies"` Masquerade *Masquerade `json:"masquerade"` }
Message struct
func (*Message) CalculateCreationDate ¶
Calculate creation date and edit the struct.
type MessageAppend ¶
type MessageAppend struct {
Embeds []*MessageEmbed `json:"embeds"`
}
type MessageEmbed ¶
type MessageEmbed struct { Type string `json:"type"` Url string `json:"url"` Special *MessageSpecialEmbed Title string `json:"title"` Description string `json:"description"` Image *MessageEmbeddedImage `json:"image"` Video *MessageEmbeddedVideo `json:"video"` IconUrl string `json:"icon_url"` Color string `json:"color"` }
Message embed struct.
type MessageEmbeddedImage ¶
type MessageEmbeddedImage struct { Size string `json:"size"` Url string `json:"url"` Width int `json:"width"` Height int `json:"height"` }
Message embedded image struct
type MessageEmbeddedVideo ¶
type MessageEmbeddedVideo struct { Url string `json:"url"` Width int `json:"width"` Height int `json:"height"` }
Message embedded video struct
type MessageSpecialEmbed ¶
type MessageSpecialEmbed struct { Type string `json:"type"` Id string `json:"id"` ContentType string `json:"content_type"` }
Message special embed struct.
type NullHandler ¶
type NullHandler struct{}
func (NullHandler) Authenticated ¶
func (NullHandler) Authenticated(context.Context) error
func (NullHandler) ChannelAck ¶
func (NullHandler) ChannelCreate ¶
func (NullHandler) ChannelCreate(context.Context, *Channel) error
func (NullHandler) ChannelDelete ¶
func (NullHandler) ChannelDelete(context.Context, string) error
func (NullHandler) ChannelGroupJoin ¶
func (NullHandler) ChannelGroupLeave ¶
func (NullHandler) ChannelStartTyping ¶
func (NullHandler) ChannelStopTyping ¶
func (NullHandler) ChannelUpdate ¶
func (NullHandler) EmojiCreate ¶
func (NullHandler) EmojiCreate(context.Context, *Emoji) error
func (NullHandler) EmojiDelete ¶
func (NullHandler) EmojiDelete(context.Context, string) error
func (NullHandler) MessageAppend ¶
func (NullHandler) MessageAppend(context.Context, string, string, *MessageAppend) error
func (NullHandler) MessageCreate ¶
func (NullHandler) MessageCreate(context.Context, *Message) error
func (NullHandler) MessageDelete ¶
func (NullHandler) MessageReact ¶
func (NullHandler) MessageRemoveReaction ¶
func (NullHandler) MessageUnreact ¶
func (NullHandler) MessageUpdate ¶
func (NullHandler) ServerChannelCreate ¶
func (NullHandler) ServerChannelDelete ¶
func (NullHandler) ServerChannelUpdate ¶
func (NullHandler) ServerCreate ¶
func (NullHandler) ServerCreate(context.Context, *Server) error
func (NullHandler) ServerDelete ¶
func (NullHandler) ServerDelete(context.Context, string) error
func (NullHandler) ServerMemberJoin ¶
func (NullHandler) ServerMemberLeave ¶
func (NullHandler) ServerMemberUpdate ¶
func (NullHandler) ServerRoleCreate ¶
func (NullHandler) ServerRoleDelete ¶
func (NullHandler) ServerRoleUpdate ¶
func (NullHandler) ServerUpdate ¶
func (NullHandler) UnknownEvent ¶
func (NullHandler) UserPlatformWipe ¶
func (NullHandler) UserRelationship ¶
func (NullHandler) UserUpdate ¶
type Permissions ¶
type Permissions struct { Bitvise uint Mode string // can ben CHANNEL, SERVER or USER Permissions map[string]uint }
Permissions struct
func (*Permissions) Add ¶
func (p *Permissions) Add(perms ...string) *Permissions
Add new permission(s).
func (Permissions) Calculate ¶
func (p Permissions) Calculate(perms ...string) uint
Calculate perms and return unsigned int.
func (Permissions) Has ¶
func (p Permissions) Has(perm string) bool
Calculate if bitvise has permission
func (*Permissions) InitChannel ¶
func (p *Permissions) InitChannel() *Permissions
Init all of the perms for channel.
func (*Permissions) InitServer ¶
func (p *Permissions) InitServer() *Permissions
Init all of the perms for server.
func (*Permissions) InitUser ¶
func (p *Permissions) InitUser() *Permissions
Init all of the perms for user.
func (*Permissions) Remove ¶
func (p *Permissions) Remove(perms ...string) *Permissions
Remove permission(s).
type RevoltAutumn ¶
type RevoltBuild ¶
type RevoltCaptcha ¶
type RevoltFeatures ¶
type RevoltFeatures struct { Captcha RevoltCaptcha `json:"captcha"` Email bool `json:"email"` InviteOnly bool `json:"invite_only"` Autumn RevoltAutumn `json:"autumn"` January RevoltJanuary `json:"january"` Voso RevoltVoso `json:"voso"` }
type RevoltJanuary ¶
type RevoltSettings ¶
type RevoltSettings struct { Revolt string `json:"revolt"` Features RevoltFeatures `json:"features"` Ws string `json:"ws"` App string `json:"app"` Vapid string `json:"vapid"` Build RevoltBuild `json:"build"` }
type RevoltVoso ¶
type SelfBot ¶
type SelfBot struct { Email string `json:"-"` Password string `json:"-"` Id string `json:"id"` UserId string `json:"user_id"` SessionToken string `json:"token"` }
Self bot struct.
type SendMessage ¶
type SendMessage struct { Content string `json:"content"` Nonce string `json:"nonce,omitempty"` Attachments []string `json:"attachments,omitempty"` Replies []Replies `json:"replies,omitempty"` Embeds []SendableEmbed `json:"embeds,omitempty"` DeleteAfter uint `json:"-"` Masquerade *Masquerade `json:"masquerade,omitempty"` }
Similar to message, but created for send message function.
func (*SendMessage) AddAttachment ¶
func (sms *SendMessage) AddAttachment(attachment string) *SendMessage
Add a new attachment.
func (*SendMessage) AddReply ¶
func (sms *SendMessage) AddReply(id string, mention bool) *SendMessage
Add a new reply.
func (*SendMessage) CreateNonce ¶
func (sms *SendMessage) CreateNonce() *SendMessage
Create a unique nonce.
func (*SendMessage) SetContent ¶
func (sms *SendMessage) SetContent(content string) *SendMessage
Set content.
func (*SendMessage) SetContentf ¶
func (sms *SendMessage) SetContentf(format string, values ...interface{}) *SendMessage
Set and format content.
func (*SendMessage) SetDeleteAfter ¶
func (sms *SendMessage) SetDeleteAfter(second uint) *SendMessage
Set delete after option.
type SendableEmbed ¶
type Server ¶
type Server struct { CreatedAt time.Time Id string `json:"_id"` Nonce string `json:"nonce"` OwnerId string `json:"owner"` Name string `json:"name"` Description string `json:"description"` ChannelIds []string `json:"channels"` Categories []*ServerCategory `json:"categories"` SystemMessages *ServerSystemMessages `json:"system_messages"` Roles map[string]interface{} `json:"roles"` DefaultPermissions uint `json:"default_permissions"` Icon *Attachment `json:"icon"` Banner *Attachment `json:"banner"` }
Server struct.
func (*Server) CalculateCreationDate ¶
Calculate creation date and edit the struct.
type ServerCategory ¶
type ServerCategory struct { Id string `json:"id"` Title string `json:"title"` ChannelIds []string `json:"channels"` }
Server categories struct.
type ServerSystemMessages ¶
type ServerSystemMessages struct { UserJoined string `json:"user_joined,omitempty"` UserLeft string `json:"user_left,omitempty"` UserKicked string `json:"user_kicked,omitempty"` UserBanned string `json:"user_banned,omitempty"` UserTimeout string `json:"user_timeout,omitempty"` }
System messages struct.
type User ¶
type User struct { Client *Client CreatedAt time.Time Id string `json:"_id"` Username string `json:"username"` Avatar *Attachment `json:"avatar"` Relations []*UserRelations `json:"relations"` Badges int `json:"badges"` Status *UserStatus `json:"status"` Relationship string `json:"relationship"` IsOnline bool `json:"online"` Flags int `json:"flags"` BotInformation *BotInformation `json:"bot"` }
User struct.
func (*User) CalculateCreationDate ¶
Calculate creation date and edit the struct.
type UserRelations ¶
User relations struct.
type UserStatus ¶
User status struct.