Documentation ¶
Index ¶
- Constants
- 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
- func (c Channel) AddGroupRecipient(user_id string) error
- func (c *Channel) BeginTyping()
- func (c *Channel) CalculateCreationDate() error
- func (c Channel) CreateInvite() (string, error)
- func (c Channel) Delete() error
- func (c Channel) DeleteGroupRecipient(user_id string) error
- func (c Channel) Edit(ec *EditChannel) error
- func (c *Channel) EndTyping()
- func (c Channel) FetchGroupMembers() ([]*User, error)
- func (c Channel) FetchMessage(id string) (*Message, error)
- func (c Channel) FetchMessages(options map[string]interface{}) (*FetchedMessages, error)
- func (c Channel) SendMessage(message *SendMessage) (*Message, error)
- func (c Channel) SetPermissions(role_id string, permissions uint) error
- type Client
- func (c Client) AddFriend(username string) (*UserRelations, error)
- func (c *Client) Auth() error
- func (c *Client) CreateBot(name string) (*Bot, error)
- func (c *Client) CreateGroup(name, description string, users []string) (*Channel, error)
- func (c *Client) CreateServer(name, description string) (*Server, error)
- func (c *Client) Destroy()
- func (c Client) Edit(eu *EditUser) error
- func (c *Client) FetchBot(id string) (*Bot, error)
- func (c *Client) FetchBots() (*FetchedBots, error)
- func (c *Client) FetchChannel(id string) (*Channel, error)
- func (c *Client) FetchDirectMessages() ([]*Channel, error)
- func (c Client) FetchRelationships() ([]*UserRelations, error)
- func (c *Client) FetchServer(id string) (*Server, error)
- func (c *Client) FetchUser(id string) (*User, error)
- func (c *Client) OnChannelCreate(fn func(channel *Channel))
- func (c *Client) OnChannelDelete(fn func(channel_id string))
- func (c *Client) OnChannelStartTyping(fn func(channel_id, user_id string))
- func (c *Client) OnChannelStopTyping(fn func(channel_id, user_id string))
- func (c *Client) OnChannelUpdate(fn func(channel_id, clear string, payload map[string]interface{}))
- func (c *Client) OnMessage(fn func(message *Message))
- func (c *Client) OnMessageDelete(fn func(channel_id, message_id string))
- func (c *Client) OnMessageUpdate(fn func(channel_id, message_id string, payload map[string]interface{}))
- func (c *Client) OnReady(fn func())
- func (c *Client) OnServerDelete(fn func(server_id string))
- func (c *Client) OnServerMemberJoin(fn func(server_id string, user_id string))
- func (c *Client) OnServerMemberLeave(fn func(server_id string, user_id string))
- func (c *Client) OnServerMemberUpdate(fn func(server_id, clear string, payload map[string]interface{}))
- func (c *Client) OnServerUpdate(fn func(server_id, clear string, payload map[string]interface{}))
- func (c *Client) OnUnknownEvent(fn func(message string))
- func (c Client) RemoveFriend(username string) (*UserRelations, error)
- func (c Client) Request(method, path string, data []byte) ([]byte, error)
- func (c *Client) Start()
- 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 *SystemMessages) *EditServer
- type EditUser
- type FetchedBans
- type FetchedBots
- type FetchedMembers
- type FetchedMessages
- type Member
- type Message
- type MessageEdited
- type MessageEmbed
- type MessageEmbeddedImage
- type MessageEmbeddedVideo
- type MessageSpecialEmbed
- 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 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
- func (s Server) BanMember(id, reason string) error
- func (s *Server) CalculateCreationDate() error
- func (s Server) CreateRole(name string) (string, uint, uint, error)
- func (s Server) CreateTextChannel(name, description string) (*Channel, error)
- func (s Server) CreateVoiceChannel(name, description string) (*Channel, error)
- func (s Server) Delete() error
- func (s Server) DeleteRole(id string) error
- func (s Server) Edit(es *EditServer) error
- func (s Server) EditMember(id string, em *EditMember) error
- func (s Server) EditRole(id string, er *EditRole) error
- func (s Server) FetchBans() (*FetchedBans, error)
- func (s Server) FetchMember(id string) (*Member, error)
- func (s Server) FetchMembers() (*FetchedMembers, error)
- func (s Server) KickMember(id string) error
- func (s Server) SetPermissions(role_id string, channel_permissions, server_permissions uint) error
- func (s Server) UnbanMember(id string) error
- type ServerCategory
- type SystemMessages
- type User
- func (u User) Block() (*UserRelations, error)
- func (u *User) CalculateCreationDate() error
- func (u User) CreateDirectMessage() (*Channel, error)
- func (u User) FetchDefaultAvatar() (*Binary, error)
- func (u User) FetchRelationship() (*UserRelations, error)
- func (u User) FormatMention() string
- func (u User) Unblock() (*UserRelations, error)
- type UserRelations
- type UserStatus
Constants ¶
const ( WS_URL = "wss://ws.revolt.chat" API_URL = "https://api.revolt.chat" )
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 ¶ added in v0.3.0
type Bot struct { Client *Client 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 ¶ added in v0.3.0
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 { Client *Client CreatedAt time.Time Id string `json:"_id"` ChannelType string `json:"channel_type"` UserId string `json:"user"` Nonce string `json:"nonce"` Active bool `json:"active"` Recipients []string `json:"recipients"` LastMessage interface{} `json:"last_message"` Name string `json:"name"` OwnerId string `json:"owner"` Description string `json:"description"` Icon *Attachment `json:"icon"` DefaultPermissions uint `json:"default_permissions"` RolePermissions interface{} `json:"role_permissions"` Permissions uint `json:"permissions"` }
Channel struct.
func (Channel) AddGroupRecipient ¶
Add a new group recipient. This function is only for GroupChannel.
func (*Channel) BeginTyping ¶ added in v0.3.3
func (c *Channel) BeginTyping()
Send a typing start event to the channel.
func (*Channel) CalculateCreationDate ¶
Calculate creation date and edit the struct.
func (Channel) CreateInvite ¶
Create a new invite. Returns a string (invite code) and error (nil if not exists).
func (Channel) DeleteGroupRecipient ¶
Delete a group recipient. This function is only for GroupChannel.
func (*Channel) EndTyping ¶ added in v0.3.3
func (c *Channel) EndTyping()
End the typing event in the channel.
func (Channel) FetchGroupMembers ¶
Fetch all of the members from group. This function is only for GroupChannel.
func (Channel) FetchMessage ¶
Fetch a message from channel by Id.
func (Channel) FetchMessages ¶
func (c Channel) FetchMessages(options map[string]interface{}) (*FetchedMessages, error)
Fetch messages from channel. Check: https://developers.revolt.chat/api/#tag/Messaging/paths/~1channels~1:channel~1messages/get for map parameters.
func (Channel) SendMessage ¶
func (c Channel) SendMessage(message *SendMessage) (*Message, error)
Send a message to the channel.
type Client ¶
type Client struct { SelfBot *SelfBot Token string Socket gowebsocket.Socket HTTP *http.Client Cache *Cache // Event Functions OnReadyFunctions []func() OnMessageFunctions []func(message *Message) OnMessageUpdateFunctions []func(channel_id, message_id string, payload map[string]interface{}) OnMessageDeleteFunctions []func(channel_id, message_id string) OnChannelCreateFunctions []func(channel *Channel) OnChannelUpdateFunctions []func(channel_id, clear string, payload map[string]interface{}) OnChannelDeleteFunctions []func(channel_id string) OnUnknownEventFunctions []func(message string) OnChannelStartTypingFunctions []func(channel_id, user_id string) OnChannelStopTypingFunctions []func(channel_id, user_id string) OnServerUpdateFunctions []func(server_id, clear string, payload map[string]interface{}) OnServerDeleteFunctions []func(server_id string) OnServerMemberUpdateFunctions []func(server_id, clear string, payload map[string]interface{}) OnServerMemberJoinFunctions []func(server_id, user_id string) OnServerMemberLeaveFunctions []func(server_id, user_id string) }
Client struct.
func (Client) AddFriend ¶ added in v0.2.0
func (c Client) AddFriend(username string) (*UserRelations, error)
Send friend request. / Accept friend request. User relations struct only will have status. id is not defined for this function.
func (*Client) CreateGroup ¶
Create a new group. Users parameter is a list of users will be added.
func (*Client) CreateServer ¶
Create a server.
func (*Client) FetchBots ¶ added in v0.3.0
func (c *Client) FetchBots() (*FetchedBots, error)
Fetch client bots.
func (*Client) FetchChannel ¶
Fetch a channel by Id.
func (*Client) FetchDirectMessages ¶
Fetch all of the DMs.
func (Client) FetchRelationships ¶ added in v0.2.0
func (c Client) FetchRelationships() ([]*UserRelations, error)
Fetch relationships.
func (*Client) FetchServer ¶
Fetch a server by Id.
func (*Client) OnChannelCreate ¶
On channel create event will run when someone creates a channel.
func (*Client) OnChannelDelete ¶
On channel delete event will run when someone deletes a channel.
func (*Client) OnChannelStartTyping ¶
On channel start typing will run when someone starts to type a message.
func (*Client) OnChannelStopTyping ¶
On channel stop typing will run when someone stops the typing status.
func (*Client) OnChannelUpdate ¶
On channel update event will run when someone updates a channel.
func (*Client) OnMessageDelete ¶
On message delete event will run when someone deletes a message.
func (*Client) OnMessageUpdate ¶
func (c *Client) OnMessageUpdate(fn func(channel_id, message_id string, payload map[string]interface{}))
On message update event will run when someone updates a message.
func (*Client) OnReady ¶
func (c *Client) OnReady(fn func())
On ready event will run when websocket connection is started and bot is ready to work.
func (*Client) OnServerDelete ¶
On server delete will run when someone deletes a server.
func (*Client) OnServerMemberJoin ¶ added in v0.1.1
On server member join will run when someone joins to the server.
func (*Client) OnServerMemberLeave ¶ added in v0.1.1
On server member leave will run when someone left from server.
func (*Client) OnServerMemberUpdate ¶ added in v0.1.1
func (c *Client) OnServerMemberUpdate(fn func(server_id, clear string, payload map[string]interface{}))
On server member update will run when a server member updates.
func (*Client) OnServerUpdate ¶
On server update will run when someone updates a server.
func (*Client) OnUnknownEvent ¶
On unknown event will run when client gets a unknown event.
func (Client) RemoveFriend ¶ added in v0.2.0
func (c Client) RemoveFriend(username string) (*UserRelations, error)
Deny friend request. / Remove friend. User relations struct only will have status. id is not defined for this function.
type EditBot ¶ added in v0.3.0
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 ¶ added in v0.3.0
Remove interaction url for struct.
func (*EditBot) SetInteractionsUrl ¶ added in v0.3.0
Set interaction url for struct.
func (*EditBot) SetPublicValue ¶ added in v0.3.0
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"` Colour 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 *SystemMessages `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 *SystemMessages) *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 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 ¶ added in v0.3.0
Fetched bots struct.
type FetchedMembers ¶
Fetched members struct.
type FetchedMessages ¶
Fetched messages struct.
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 { Client *Client CreatedAt time.Time Id string `json:"_id"` Nonce string `json:"nonce"` ChannelId string `json:"channel"` AuthorId string `json:"author"` Content interface{} `json:"content"` Edited interface{} `json:"edited"` Embeds []*MessageEmbed `json:"embeds"` Attachments []*Attachment `json:"attachments"` Mentions []string `json:"mentions"` Replies []string `json:"replies"` }
Message struct
func (*Message) CalculateCreationDate ¶
Calculate creation date and edit the struct.
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 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 SelfBot ¶
type SelfBot struct { Email string `json:"-"` Password string `json:"-"` Id string `json:"id"` UserId string `json:"user_id"` SessionToken string `json:"session_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:"-"` }
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 ¶ added in v0.3.2
type Server ¶
type Server struct { Client *Client 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 *SystemMessages `json:"system_messages"` Roles map[string]interface{} `json:"roles"` DefaultPermissions []interface{} `json:"default_permissions"` Icon *Attachment `json:"icon"` Banner *Attachment `json:"banner"` }
Server struct.
func (*Server) CalculateCreationDate ¶
Calculate creation date and edit the struct.
func (Server) CreateRole ¶
Create a new role for server. Returns string (role id), uint (server perms), uint (channel perms) and error.
func (Server) CreateTextChannel ¶
Create a new text-channel.
func (Server) CreateVoiceChannel ¶
Create a new voice-channel.
func (Server) Delete ¶
Delete / leave server. If the server not created by client, it will leave. Otherwise it will be deleted.
func (Server) EditMember ¶
func (s Server) EditMember(id string, em *EditMember) error
Edit a member.
func (Server) FetchMember ¶
Fetch a member from Server.
func (Server) FetchMembers ¶
func (s Server) FetchMembers() (*FetchedMembers, error)
Fetch all of the members from Server.
func (Server) SetPermissions ¶
Set server permissions for a role. Leave role field empty if you want to edit default permissions
func (Server) UnbanMember ¶
Unban a member from server.
type ServerCategory ¶
type ServerCategory struct { Id string `json:"id"` Title string `json:"title"` ChannelIds []string `json:"channels"` }
Server categories struct.
type SystemMessages ¶
type SystemMessages struct { UserJoined string `json:"user_joined,omitempty"` UserLeft string `json:"user_left,omitempty"` UserKicked string `json:"user_kicker,omitempty"` UserBanned string `json:"user_banned,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.
func (User) CreateDirectMessage ¶
Create a DM with the user.
func (User) FetchDefaultAvatar ¶ added in v0.1.1
Fetch default user avatar.
func (User) FetchRelationship ¶ added in v0.2.0
func (u User) FetchRelationship() (*UserRelations, error)
Fetch user relationship.
func (User) Unblock ¶ added in v0.2.0
func (u User) Unblock() (*UserRelations, error)
Un-block user.
type UserRelations ¶
User relations struct.
type UserStatus ¶
User status struct.