Documentation ¶
Overview ¶
Disgord
Index ¶
- Constants
- func Unmarshal(data []byte, box interface{})
- type ChannelCreateCallback
- type ChannelDeleteCallback
- type ChannelPinsUpdateCallback
- type ChannelUpdateCallback
- type Client
- func (c *Client) AddGuildMember(guildID, userID Snowflake, params *rest.AddGuildMemberParams) (ret *resource.Member, err error)
- func (c *Client) AddGuildMemberRole(guildID, userID, roleID Snowflake) (err error)
- func (c *Client) AddListener(evtName string, listener interface{})
- func (c *Client) AddListenerOnce(evtName string, listener interface{})
- func (c *Client) AddPinnedChannelMessage(channelID, msgID Snowflake) (err error)
- func (c *Client) BeginGuildPrune(id Snowflake, params *rest.GuildPruneParams) (ret *resource.GuildPruneCount, err error)
- func (c *Client) BulkDeleteMessages(chanID Snowflake, params *rest.BulkDeleteMessagesParams) (err error)
- func (c *Client) ChannelChan(channelID Snowflake) <-chan *resource.Channel
- func (c *Client) ChannelsChan(GuildID Snowflake) <-chan map[Snowflake]*resource.Channel
- func (c *Client) Connect() (err error)
- func (c *Client) CreateChannelInvites(id Snowflake, params *rest.CreateChannelInvitesParams) (ret *resource.Invite, err error)
- func (c *Client) CreateChannelMessage(channelID Snowflake, params *rest.CreateMessageParams) (ret *resource.Message, err error)
- func (c *Client) CreateDM(recipientID Snowflake) (ret *resource.Channel, err error)
- func (c *Client) CreateGroupDM(params *rest.CreateGroupDMParams) (ret *resource.Channel, err error)
- func (c *Client) CreateGuild(params *rest.CreateGuildParams) (ret *resource.Guild, err error)
- func (c *Client) CreateGuildBan(guildID, userID Snowflake, params *rest.CreateGuildBanParams) (err error)
- func (c *Client) CreateGuildChannel(id Snowflake, params *rest.CreateGuildChannelParams) (ret *resource.Channel, err error)
- func (c *Client) CreateGuildEmoji(guildID Snowflake) (ret *resource.Emoji, err error)
- func (c *Client) CreateGuildIntegration(guildID Snowflake, params *rest.CreateGuildIntegrationParams) (err error)
- func (c *Client) CreateGuildRole(id Snowflake, params *rest.CreateGuildRoleParams) (ret *resource.Role, err error)
- func (c *Client) CreateReaction(channelID, messageID Snowflake, emoji interface{}) (ret *resource.Reaction, err error)
- func (c *Client) CreateWebhook(channelID Snowflake, params *rest.CreateWebhookParams) (ret *resource.Webhook, err error)
- func (c *Client) DeleteAllReactions(channelID, messageID Snowflake) (err error)
- func (c *Client) DeleteChannel(id Snowflake) (err error)
- func (c *Client) DeleteChannelPermission(channelID, overwriteID Snowflake) (err error)
- func (c *Client) DeleteGuild(id Snowflake) (err error)
- func (c *Client) DeleteGuildEmoji(guildID, emojiID Snowflake) (err error)
- func (c *Client) DeleteGuildIntegration(guildID, integrationID Snowflake) (err error)
- func (c *Client) DeleteGuildRole(guildID, roleID Snowflake) (err error)
- func (c *Client) DeleteInvite(inviteCode string) (invite *resource.Invite, err error)
- func (c *Client) DeleteMessage(channelID, msgID Snowflake) (err error)
- func (c *Client) DeleteOwnReaction(channelID, messageID Snowflake, emoji interface{}) (err error)
- func (c *Client) DeletePinnedChannelMessage(channelID, msgID Snowflake) (err error)
- func (c *Client) DeleteUserReaction(channelID, messageID, userID Snowflake, emoji interface{}) (err error)
- func (c *Client) DeleteWebhook(webhookID Snowflake) (err error)
- func (c *Client) DeleteWebhookWithToken(id Snowflake, token string) (err error)
- func (c *Client) Disconnect() (err error)
- func (c *Client) EditChannelPermissions(chanID, overwriteID Snowflake, params *rest.EditChannelPermissionsParams) (err error)
- func (c *Client) EditMessage(chanID, msgID Snowflake, params *rest.EditMessageParams) (ret *resource.Message, err error)
- func (c *Client) Evt() EvtDispatcher
- func (c *Client) ExecuteGitHubWebhook(params *rest.ExecuteWebhookParams, wait bool) (err error)
- func (c *Client) ExecuteSlackWebhook(params *rest.ExecuteWebhookParams, wait bool) (err error)
- func (c *Client) ExecuteWebhook(params *rest.ExecuteWebhookParams, wait bool, URLSuffix string) (err error)
- func (c *Client) GetChannel(id Snowflake) (ret *resource.Channel, err error)
- func (c *Client) GetChannelInvites(id Snowflake) (ret []*resource.Invite, err error)
- func (c *Client) GetChannelMessage(channelID, messageID Snowflake) (ret *resource.Message, err error)
- func (c *Client) GetChannelMessages(channelID Snowflake, params rest.URLParameters) (ret []*resource.Message, err error)
- func (c *Client) GetChannelWebhooks(channelID Snowflake) (ret []*resource.Webhook, err error)
- func (c *Client) GetCurrentUser() (ret *resource.User, err error)
- func (c *Client) GetCurrentUserGuilds(params *rest.GetCurrentUserGuildsParams) (ret []*resource.Guild, err error)
- func (c *Client) GetGuild(id Snowflake) (ret *resource.Guild, err error)
- func (c *Client) GetGuildAuditLogs(guildID Snowflake, params *rest.AuditLogParams) (log *resource.AuditLog, err error)
- func (c *Client) GetGuildBan(guildID, userID Snowflake) (ret *resource.Ban, err error)
- func (c *Client) GetGuildBans(id Snowflake) (ret []*resource.Ban, err error)
- func (c *Client) GetGuildChannels(id Snowflake) (ret []*resource.Channel, err error)
- func (c *Client) GetGuildEmbed(guildID Snowflake) (ret *resource.GuildEmbed, err error)
- func (c *Client) GetGuildEmoji(guildID, emojiID Snowflake) (ret *resource.Emoji, err error)
- func (c *Client) GetGuildEmojis(id Snowflake) (ret []*resource.Emoji, err error)
- func (c *Client) GetGuildIntegrations(id Snowflake) (ret []*resource.Integration, err error)
- func (c *Client) GetGuildInvites(id Snowflake) (ret []*resource.Invite, err error)
- func (c *Client) GetGuildMember(guildID, userID Snowflake) (ret *resource.Member, err error)
- func (c *Client) GetGuildMembers(guildID, after Snowflake, limit int) (ret []*resource.Member, err error)
- func (c *Client) GetGuildPruneCount(id Snowflake, params *rest.GuildPruneParams) (ret *resource.GuildPruneCount, err error)
- func (c *Client) GetGuildRoles(guildID Snowflake) (ret []*resource.Role, err error)
- func (c *Client) GetGuildVanityURL(guildID Snowflake) (ret *resource.PartialInvite, err error)
- func (c *Client) GetGuildVoiceRegions(id Snowflake) (ret []*resource.VoiceRegion, err error)
- func (c *Client) GetGuildWebhooks(guildID Snowflake) (ret []*resource.Webhook, err error)
- func (c *Client) GetInvite(inviteCode string, withCounts bool) (invite *resource.Invite, err error)
- func (c *Client) GetPinnedMessages(channelID Snowflake) (ret []*resource.Message, err error)
- func (c *Client) GetReaction(channelID, messageID Snowflake, emoji interface{}, params rest.URLParameters) (ret []*resource.User, err error)
- func (c *Client) GetUser(id Snowflake) (ret *resource.User, err error)
- func (c *Client) GetUserConnections() (ret []*resource.UserConnection, err error)
- func (c *Client) GetUserDMs() (ret []*resource.Channel, err error)
- func (c *Client) GetVoiceRegions() (ret []*resource.VoiceRegion, err error)
- func (c *Client) GetWebhook(id Snowflake) (ret *resource.Webhook, err error)
- func (c *Client) GetWebhookWithToken(id Snowflake, token string) (ret *resource.Webhook, err error)
- func (c *Client) GroupDMAddRecipient(channelID, userID Snowflake, params *rest.GroupDMAddRecipientParams) (err error)
- func (c *Client) GroupDMRemoveRecipient(channelID, userID Snowflake) (err error)
- func (c *Client) GuildChan(guildID Snowflake) <-chan *resource.Guild
- func (c *Client) LeaveGuild(id Snowflake) (err error)
- func (c *Client) MemberChan(guildID, userID Snowflake) <-chan *resource.Member
- func (c *Client) MembersChan(guildID Snowflake) <-chan map[Snowflake]*resource.Member
- func (c *Client) ModifyChannel(changes *rest.ModifyChannelParams) (ret *resource.Channel, err error)
- func (c *Client) ModifyCurrentUser(params *rest.ModifyCurrentUserParams) (ret *resource.User, err error)
- func (c *Client) ModifyCurrentUserNick(id Snowflake, params *rest.ModifyCurrentUserNickParams) (nick string, err error)
- func (c *Client) ModifyGuild(id Snowflake, params *rest.ModifyGuildParams) (ret *resource.Guild, err error)
- func (c *Client) ModifyGuildEmbed(guildID Snowflake, params *resource.GuildEmbed) (ret *resource.GuildEmbed, err error)
- func (c *Client) ModifyGuildEmoji(guildID, emojiID Snowflake) (ret *resource.Emoji, err error)
- func (c *Client) ModifyGuildIntegration(guildID, integrationID Snowflake, params *rest.ModifyGuildIntegrationParams) (err error)
- func (c *Client) ModifyGuildMember(guildID, userID Snowflake, params *rest.ModifyGuildMemberParams) (err error)
- func (c *Client) ModifyGuildRole(guildID, roleID Snowflake, params *rest.ModifyGuildRoleParams) (ret []*resource.Role, err error)
- func (c *Client) ModifyGuildRolePositions(guildID Snowflake, params *rest.ModifyGuildRolePositionsParams) (ret []*resource.Role, err error)
- func (c *Client) ModifyWebhook(newWebhook *resource.Webhook) (ret *resource.Webhook, err error)
- func (c *Client) ModifyWebhookWithToken(newWebhook *resource.Webhook) (ret *resource.Webhook, err error)
- func (c *Client) MsgChan(msgID Snowflake) <-chan *resource.Message
- func (c *Client) RateLimiter() httd.RateLimiter
- func (c *Client) RemoveGuildBan(guildID, userID Snowflake) (err error)
- func (c *Client) RemoveGuildMember(guildID, userID Snowflake) (err error)
- func (c *Client) RemoveGuildMemberRole(guildID, userID, roleID Snowflake) (err error)
- func (c *Client) Req() httd.Requester
- func (c *Client) State() state.Cacher
- func (c *Client) String() string
- func (c *Client) SyncGuildIntegration(guildID, integrationID Snowflake) (err error)
- func (c *Client) TriggerTypingIndicator(channelID Snowflake) (err error)
- func (c *Client) UserChan(userID Snowflake) <-chan *UserChan
- type Config
- type Dispatch
- func (d *Dispatch) AddHandler(evtName string, listener interface{})
- func (d *Dispatch) AddHandlerOnce(evtName string, listener interface{})
- func (d *Dispatch) AllChan() <-chan interface{}
- func (d *Dispatch) ChannelCreateChan() <-chan *ChannelCreateBox
- func (d *Dispatch) ChannelDeleteChan() <-chan *ChannelDeleteBox
- func (d *Dispatch) ChannelPinsUpdateChan() <-chan *ChannelPinsUpdateBox
- func (d *Dispatch) ChannelUpdateChan() <-chan *ChannelUpdateBox
- func (d *Dispatch) GuildBanAddChan() <-chan *GuildBanAddBox
- func (d *Dispatch) GuildBanRemoveChan() <-chan *GuildBanRemoveBox
- func (d *Dispatch) GuildCreateChan() <-chan *GuildCreateBox
- func (d *Dispatch) GuildDeleteChan() <-chan *GuildDeleteBox
- func (d *Dispatch) GuildEmojisUpdateChan() <-chan *GuildEmojisUpdateBox
- func (d *Dispatch) GuildIntegrationsUpdateChan() <-chan *GuildIntegrationsUpdateBox
- func (d *Dispatch) GuildMemberAddChan() <-chan *GuildMemberAddBox
- func (d *Dispatch) GuildMemberRemoveChan() <-chan *GuildMemberRemoveBox
- func (d *Dispatch) GuildMemberUpdateChan() <-chan *GuildMemberUpdateBox
- func (d *Dispatch) GuildMembersChunkChan() <-chan *GuildMembersChunkBox
- func (d *Dispatch) GuildRoleCreateChan() <-chan *GuildRoleCreateBox
- func (d *Dispatch) GuildRoleDeleteChan() <-chan *GuildRoleDeleteBox
- func (d *Dispatch) GuildRoleUpdateChan() <-chan *GuildRoleUpdateBox
- func (d *Dispatch) GuildUpdateChan() <-chan *GuildUpdateBox
- func (d *Dispatch) MessageCreateChan() <-chan *MessageCreateBox
- func (d *Dispatch) MessageDeleteBulkChan() <-chan *MessageDeleteBulkBox
- func (d *Dispatch) MessageDeleteChan() <-chan *MessageDeleteBox
- func (d *Dispatch) MessageReactionAddChan() <-chan *MessageReactionAddBox
- func (d *Dispatch) MessageReactionRemoveAllChan() <-chan *MessageReactionRemoveAllBox
- func (d *Dispatch) MessageReactionRemoveChan() <-chan *MessageReactionRemoveBox
- func (d *Dispatch) MessageUpdateChan() <-chan *MessageUpdateBox
- func (d *Dispatch) PresenceUpdateChan() <-chan *PresenceUpdateBox
- func (d *Dispatch) ReadyChan() <-chan *ReadyBox
- func (d *Dispatch) ResumedChan() <-chan *ResumedBox
- func (d *Dispatch) TypingStartChan() <-chan *TypingStartBox
- func (d *Dispatch) UserUpdateChan() <-chan *UserUpdateBox
- func (d *Dispatch) VoiceServerUpdateChan() <-chan *VoiceServerUpdateBox
- func (d *Dispatch) VoiceStateUpdateChan() <-chan *VoiceStateUpdateBox
- func (d *Dispatch) WebhooksUpdateChan() <-chan *WebhooksUpdateBox
- type EventCallback
- type EvtDispatcher
- type GuildBanAddCallback
- type GuildBanRemoveCallback
- type GuildCreateCallback
- type GuildDeleteCallback
- type GuildEmojisUpdateCallback
- type GuildIntegrationsUpdateCallback
- type GuildMemberAddCallback
- type GuildMemberRemoveCallback
- type GuildMemberUpdateCallback
- type GuildMembersChunkCallback
- type GuildRoleCreateCallback
- type GuildRoleDeleteCallback
- type GuildRoleUpdateCallback
- type GuildUpdateCallback
- type HelloCallback
- type InvalidSessionCallback
- type MessageCreateCallback
- type MessageDeleteBulkCallback
- type MessageDeleteCallback
- type MessageReactionAddCallback
- type MessageReactionRemoveAllCallback
- type MessageReactionRemoveCallback
- type MessageUpdateCallback
- type PresenceUpdateCallback
- type ReadyCallback
- type ResumedCallback
- type Session
- type TypingStartCallback
- type UserChan
- type UserUpdateCallback
- type VoiceServerUpdateCallback
- type VoiceStateUpdateCallback
- type WebhooksUpdateCallback
Constants ¶
View Source
const ( JSONEncoding = "JSON" // APIVersion desired API version to use APIVersion = 6 // February 5, 2018 DefaultAPIVersion = 6 GitHubURL = "https://github.com/andersfylling/disgord" Version = "v0.2.0" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ChannelCreateCallback ¶
type ChannelCreateCallback = func(session Session, cc *ChannelCreateBox)
channel
type ChannelDeleteCallback ¶
type ChannelDeleteCallback = func(session Session, cd *ChannelDeleteBox)
type ChannelPinsUpdateCallback ¶
type ChannelPinsUpdateCallback = func(session Session, cpu *ChannelPinsUpdateBox)
type ChannelUpdateCallback ¶
type ChannelUpdateCallback = func(session Session, cu *ChannelUpdateBox)
type Client ¶
func NewClientMustCompile ¶
func (*Client) AddGuildMember ¶
func (*Client) AddGuildMemberRole ¶
func (*Client) AddListener ¶
func (*Client) AddListenerOnce ¶
AddListenerOnce not implemented. Do not use.
func (*Client) AddPinnedChannelMessage ¶
func (*Client) BeginGuildPrune ¶
func (c *Client) BeginGuildPrune(id Snowflake, params *rest.GuildPruneParams) (ret *resource.GuildPruneCount, err error)
func (*Client) BulkDeleteMessages ¶
func (c *Client) BulkDeleteMessages(chanID Snowflake, params *rest.BulkDeleteMessagesParams) (err error)
func (*Client) ChannelChan ¶
func (*Client) ChannelsChan ¶
func (*Client) CreateChannelInvites ¶
func (*Client) CreateChannelMessage ¶
func (*Client) CreateGroupDM ¶
func (*Client) CreateGuild ¶
Guild
func (*Client) CreateGuildBan ¶
func (c *Client) CreateGuildBan(guildID, userID Snowflake, params *rest.CreateGuildBanParams) (err error)
func (*Client) CreateGuildChannel ¶
func (*Client) CreateGuildEmoji ¶
func (*Client) CreateGuildIntegration ¶
func (c *Client) CreateGuildIntegration(guildID Snowflake, params *rest.CreateGuildIntegrationParams) (err error)
func (*Client) CreateGuildRole ¶
func (*Client) CreateReaction ¶
func (*Client) CreateWebhook ¶
func (c *Client) CreateWebhook(channelID Snowflake, params *rest.CreateWebhookParams) (ret *resource.Webhook, err error)
Webhook
func (*Client) DeleteAllReactions ¶
func (*Client) DeleteChannel ¶
func (*Client) DeleteChannelPermission ¶
func (*Client) DeleteGuild ¶
func (*Client) DeleteGuildEmoji ¶
func (*Client) DeleteGuildIntegration ¶
func (*Client) DeleteGuildRole ¶
func (*Client) DeleteInvite ¶
func (*Client) DeleteMessage ¶
func (*Client) DeleteOwnReaction ¶
func (*Client) DeletePinnedChannelMessage ¶
func (*Client) DeleteUserReaction ¶
func (*Client) DeleteWebhook ¶
func (*Client) DeleteWebhookWithToken ¶
func (*Client) Disconnect ¶
Disconnect closes the discord websocket connection
func (*Client) EditChannelPermissions ¶
func (c *Client) EditChannelPermissions(chanID, overwriteID Snowflake, params *rest.EditChannelPermissionsParams) (err error)
func (*Client) EditMessage ¶
func (*Client) Evt ¶
func (c *Client) Evt() EvtDispatcher
func (*Client) ExecuteGitHubWebhook ¶
func (c *Client) ExecuteGitHubWebhook(params *rest.ExecuteWebhookParams, wait bool) (err error)
func (*Client) ExecuteSlackWebhook ¶
func (c *Client) ExecuteSlackWebhook(params *rest.ExecuteWebhookParams, wait bool) (err error)
func (*Client) ExecuteWebhook ¶
func (*Client) GetChannel ¶
Channel
func (*Client) GetChannelInvites ¶
func (*Client) GetChannelMessage ¶
func (*Client) GetChannelMessages ¶
func (*Client) GetChannelWebhooks ¶
func (*Client) GetCurrentUser ¶
User
func (*Client) GetCurrentUserGuilds ¶
func (*Client) GetGuildAuditLogs ¶
func (c *Client) GetGuildAuditLogs(guildID Snowflake, params *rest.AuditLogParams) (log *resource.AuditLog, err error)
Audit-log
func (*Client) GetGuildBan ¶
func (*Client) GetGuildBans ¶
func (*Client) GetGuildChannels ¶
func (*Client) GetGuildEmbed ¶
func (c *Client) GetGuildEmbed(guildID Snowflake) (ret *resource.GuildEmbed, err error)
func (*Client) GetGuildEmoji ¶
func (*Client) GetGuildEmojis ¶
Emoji
func (*Client) GetGuildIntegrations ¶
func (c *Client) GetGuildIntegrations(id Snowflake) (ret []*resource.Integration, err error)
func (*Client) GetGuildInvites ¶
func (*Client) GetGuildMember ¶
func (*Client) GetGuildMembers ¶
func (*Client) GetGuildPruneCount ¶
func (c *Client) GetGuildPruneCount(id Snowflake, params *rest.GuildPruneParams) (ret *resource.GuildPruneCount, err error)
func (*Client) GetGuildRoles ¶
func (*Client) GetGuildVanityURL ¶
func (c *Client) GetGuildVanityURL(guildID Snowflake) (ret *resource.PartialInvite, err error)
func (*Client) GetGuildVoiceRegions ¶
func (c *Client) GetGuildVoiceRegions(id Snowflake) (ret []*resource.VoiceRegion, err error)
func (*Client) GetGuildWebhooks ¶
func (*Client) GetPinnedMessages ¶
func (*Client) GetReaction ¶
func (*Client) GetUserConnections ¶
func (c *Client) GetUserConnections() (ret []*resource.UserConnection, err error)
func (*Client) GetVoiceRegions ¶
func (c *Client) GetVoiceRegions() (ret []*resource.VoiceRegion, err error)
Voice
func (*Client) GetWebhook ¶
func (*Client) GetWebhookWithToken ¶
func (*Client) GroupDMAddRecipient ¶
func (c *Client) GroupDMAddRecipient(channelID, userID Snowflake, params *rest.GroupDMAddRecipientParams) (err error)
func (*Client) GroupDMRemoveRecipient ¶
func (*Client) LeaveGuild ¶
func (*Client) MemberChan ¶
func (*Client) MembersChan ¶
func (*Client) ModifyChannel ¶
func (*Client) ModifyCurrentUser ¶
func (*Client) ModifyCurrentUserNick ¶
func (c *Client) ModifyCurrentUserNick(id Snowflake, params *rest.ModifyCurrentUserNickParams) (nick string, err error)
func (*Client) ModifyGuild ¶
func (*Client) ModifyGuildEmbed ¶
func (c *Client) ModifyGuildEmbed(guildID Snowflake, params *resource.GuildEmbed) (ret *resource.GuildEmbed, err error)
func (*Client) ModifyGuildEmoji ¶
func (*Client) ModifyGuildIntegration ¶
func (c *Client) ModifyGuildIntegration(guildID, integrationID Snowflake, params *rest.ModifyGuildIntegrationParams) (err error)
func (*Client) ModifyGuildMember ¶
func (c *Client) ModifyGuildMember(guildID, userID Snowflake, params *rest.ModifyGuildMemberParams) (err error)
func (*Client) ModifyGuildRole ¶
func (*Client) ModifyGuildRolePositions ¶
func (*Client) ModifyWebhook ¶
func (*Client) ModifyWebhookWithToken ¶
func (*Client) RateLimiter ¶
func (c *Client) RateLimiter() httd.RateLimiter
func (*Client) RemoveGuildBan ¶
func (*Client) RemoveGuildMember ¶
func (*Client) RemoveGuildMemberRole ¶
func (*Client) SyncGuildIntegration ¶
func (*Client) TriggerTypingIndicator ¶
type Config ¶
type Config struct { Token string HTTPClient *http.Client APIVersion int // eg. version 6. 0 defaults to lowest supported api version APIEncoding string // eg. json, use const. defaults to json CancelRequestWhenRateLimited bool LoadAllMembers bool LoadAllChannels bool LoadAllRoles bool LoadAllPresences bool Debug bool }
type Dispatch ¶
type Dispatch struct {
// contains filtered or unexported fields
}
func NewDispatch ¶
func NewDispatch() *Dispatch
func (*Dispatch) AddHandler ¶
func (*Dispatch) AddHandlerOnce ¶
func (*Dispatch) ChannelCreateChan ¶
func (d *Dispatch) ChannelCreateChan() <-chan *ChannelCreateBox
func (*Dispatch) ChannelDeleteChan ¶
func (d *Dispatch) ChannelDeleteChan() <-chan *ChannelDeleteBox
func (*Dispatch) ChannelPinsUpdateChan ¶
func (d *Dispatch) ChannelPinsUpdateChan() <-chan *ChannelPinsUpdateBox
func (*Dispatch) ChannelUpdateChan ¶
func (d *Dispatch) ChannelUpdateChan() <-chan *ChannelUpdateBox
func (*Dispatch) GuildBanAddChan ¶
func (d *Dispatch) GuildBanAddChan() <-chan *GuildBanAddBox
func (*Dispatch) GuildBanRemoveChan ¶
func (d *Dispatch) GuildBanRemoveChan() <-chan *GuildBanRemoveBox
func (*Dispatch) GuildCreateChan ¶
func (d *Dispatch) GuildCreateChan() <-chan *GuildCreateBox
func (*Dispatch) GuildDeleteChan ¶
func (d *Dispatch) GuildDeleteChan() <-chan *GuildDeleteBox
func (*Dispatch) GuildEmojisUpdateChan ¶
func (d *Dispatch) GuildEmojisUpdateChan() <-chan *GuildEmojisUpdateBox
func (*Dispatch) GuildIntegrationsUpdateChan ¶
func (d *Dispatch) GuildIntegrationsUpdateChan() <-chan *GuildIntegrationsUpdateBox
func (*Dispatch) GuildMemberAddChan ¶
func (d *Dispatch) GuildMemberAddChan() <-chan *GuildMemberAddBox
func (*Dispatch) GuildMemberRemoveChan ¶
func (d *Dispatch) GuildMemberRemoveChan() <-chan *GuildMemberRemoveBox
func (*Dispatch) GuildMemberUpdateChan ¶
func (d *Dispatch) GuildMemberUpdateChan() <-chan *GuildMemberUpdateBox
func (*Dispatch) GuildMembersChunkChan ¶
func (d *Dispatch) GuildMembersChunkChan() <-chan *GuildMembersChunkBox
func (*Dispatch) GuildRoleCreateChan ¶
func (d *Dispatch) GuildRoleCreateChan() <-chan *GuildRoleCreateBox
func (*Dispatch) GuildRoleDeleteChan ¶
func (d *Dispatch) GuildRoleDeleteChan() <-chan *GuildRoleDeleteBox
func (*Dispatch) GuildRoleUpdateChan ¶
func (d *Dispatch) GuildRoleUpdateChan() <-chan *GuildRoleUpdateBox
func (*Dispatch) GuildUpdateChan ¶
func (d *Dispatch) GuildUpdateChan() <-chan *GuildUpdateBox
func (*Dispatch) MessageCreateChan ¶
func (d *Dispatch) MessageCreateChan() <-chan *MessageCreateBox
func (*Dispatch) MessageDeleteBulkChan ¶
func (d *Dispatch) MessageDeleteBulkChan() <-chan *MessageDeleteBulkBox
func (*Dispatch) MessageDeleteChan ¶
func (d *Dispatch) MessageDeleteChan() <-chan *MessageDeleteBox
func (*Dispatch) MessageReactionAddChan ¶
func (d *Dispatch) MessageReactionAddChan() <-chan *MessageReactionAddBox
func (*Dispatch) MessageReactionRemoveAllChan ¶
func (d *Dispatch) MessageReactionRemoveAllChan() <-chan *MessageReactionRemoveAllBox
func (*Dispatch) MessageReactionRemoveChan ¶
func (d *Dispatch) MessageReactionRemoveChan() <-chan *MessageReactionRemoveBox
func (*Dispatch) MessageUpdateChan ¶
func (d *Dispatch) MessageUpdateChan() <-chan *MessageUpdateBox
func (*Dispatch) PresenceUpdateChan ¶
func (d *Dispatch) PresenceUpdateChan() <-chan *PresenceUpdateBox
func (*Dispatch) ResumedChan ¶
func (d *Dispatch) ResumedChan() <-chan *ResumedBox
func (*Dispatch) TypingStartChan ¶
func (d *Dispatch) TypingStartChan() <-chan *TypingStartBox
func (*Dispatch) UserUpdateChan ¶
func (d *Dispatch) UserUpdateChan() <-chan *UserUpdateBox
func (*Dispatch) VoiceServerUpdateChan ¶
func (d *Dispatch) VoiceServerUpdateChan() <-chan *VoiceServerUpdateBox
func (*Dispatch) VoiceStateUpdateChan ¶
func (d *Dispatch) VoiceStateUpdateChan() <-chan *VoiceStateUpdateBox
func (*Dispatch) WebhooksUpdateChan ¶
func (d *Dispatch) WebhooksUpdateChan() <-chan *WebhooksUpdateBox
type EventCallback ¶
type EventCallback = func(session Session, box interface{})
type EvtDispatcher ¶
type EvtDispatcher interface { AllChan() <-chan interface{} // any event ReadyChan() <-chan *ReadyBox ResumedChan() <-chan *ResumedBox ChannelCreateChan() <-chan *ChannelCreateBox ChannelUpdateChan() <-chan *ChannelUpdateBox ChannelDeleteChan() <-chan *ChannelDeleteBox ChannelPinsUpdateChan() <-chan *ChannelPinsUpdateBox GuildCreateChan() <-chan *GuildCreateBox GuildUpdateChan() <-chan *GuildUpdateBox GuildDeleteChan() <-chan *GuildDeleteBox GuildBanAddChan() <-chan *GuildBanAddBox GuildBanRemoveChan() <-chan *GuildBanRemoveBox GuildEmojisUpdateChan() <-chan *GuildEmojisUpdateBox GuildIntegrationsUpdateChan() <-chan *GuildIntegrationsUpdateBox GuildMemberAddChan() <-chan *GuildMemberAddBox GuildMemberRemoveChan() <-chan *GuildMemberRemoveBox GuildMemberUpdateChan() <-chan *GuildMemberUpdateBox GuildMembersChunkChan() <-chan *GuildMembersChunkBox GuildRoleUpdateChan() <-chan *GuildRoleUpdateBox GuildRoleCreateChan() <-chan *GuildRoleCreateBox GuildRoleDeleteChan() <-chan *GuildRoleDeleteBox MessageCreateChan() <-chan *MessageCreateBox MessageUpdateChan() <-chan *MessageUpdateBox MessageDeleteChan() <-chan *MessageDeleteBox MessageDeleteBulkChan() <-chan *MessageDeleteBulkBox MessageReactionAddChan() <-chan *MessageReactionAddBox MessageReactionRemoveChan() <-chan *MessageReactionRemoveBox MessageReactionRemoveAllChan() <-chan *MessageReactionRemoveAllBox PresenceUpdateChan() <-chan *PresenceUpdateBox TypingStartChan() <-chan *TypingStartBox UserUpdateChan() <-chan *UserUpdateBox VoiceStateUpdateChan() <-chan *VoiceStateUpdateBox VoiceServerUpdateChan() <-chan *VoiceServerUpdateBox WebhooksUpdateChan() <-chan *WebhooksUpdateBox AddHandler(evtName string, listener interface{}) AddHandlerOnce(evtName string, listener interface{}) }
type GuildBanAddCallback ¶
type GuildBanAddCallback = func(session Session, gba *GuildBanAddBox)
type GuildBanRemoveCallback ¶
type GuildBanRemoveCallback = func(session Session, gbr *GuildBanRemoveBox)
type GuildCreateCallback ¶
type GuildCreateCallback = func(session Session, gc *GuildCreateBox)
Guild in general
type GuildDeleteCallback ¶
type GuildDeleteCallback = func(session Session, gd *GuildDeleteBox)
type GuildEmojisUpdateCallback ¶
type GuildEmojisUpdateCallback = func(session Session, geu *GuildEmojisUpdateBox)
type GuildIntegrationsUpdateCallback ¶
type GuildIntegrationsUpdateCallback = func(session Session, giu *GuildIntegrationsUpdateBox)
type GuildMemberAddCallback ¶
type GuildMemberAddCallback = func(session Session, gma *GuildMemberAddBox)
Guild Member
type GuildMemberRemoveCallback ¶
type GuildMemberRemoveCallback = func(session Session, gmr *GuildMemberRemoveBox)
type GuildMemberUpdateCallback ¶
type GuildMemberUpdateCallback = func(session Session, gmu *GuildMemberUpdateBox)
type GuildMembersChunkCallback ¶
type GuildMembersChunkCallback = func(session Session, gmc *GuildMembersChunkBox)
type GuildRoleCreateCallback ¶
type GuildRoleCreateCallback = func(session Session, grc *GuildRoleCreateBox)
Guild role
type GuildRoleDeleteCallback ¶
type GuildRoleDeleteCallback = func(session Session, grd *GuildRoleDeleteBox)
type GuildRoleUpdateCallback ¶
type GuildRoleUpdateCallback = func(session Session, gru *GuildRoleUpdateBox)
type GuildUpdateCallback ¶
type GuildUpdateCallback = func(session Session, gu *GuildUpdateBox)
type InvalidSessionCallback ¶
type InvalidSessionCallback = func(session Session, is *InvalidSessionBox)
type MessageCreateCallback ¶
type MessageCreateCallback = func(session Session, mc *MessageCreateBox)
message
type MessageDeleteBulkCallback ¶
type MessageDeleteBulkCallback = func(session Session, mdb *MessageDeleteBulkBox)
type MessageDeleteCallback ¶
type MessageDeleteCallback = func(session Session, md *MessageDeleteBox)
type MessageReactionAddCallback ¶
type MessageReactionAddCallback = func(session Session, mra *MessageReactionAddBox)
message reaction
type MessageReactionRemoveAllCallback ¶
type MessageReactionRemoveAllCallback = func(session Session, mrra *MessageReactionRemoveAllBox)
type MessageReactionRemoveCallback ¶
type MessageReactionRemoveCallback = func(session Session, mrr *MessageReactionRemoveBox)
type MessageUpdateCallback ¶
type MessageUpdateCallback = func(session Session, mu *MessageUpdateBox)
type PresenceUpdateCallback ¶
type PresenceUpdateCallback = func(session Session, pu *PresenceUpdateBox)
presence
type ReadyCallback ¶
type ReadyCallback = func(session Session, r *ReadyBox)
type ResumedCallback ¶
type ResumedCallback = func(session Session, r *ResumedBox)
type Session ¶
type Session interface { // Request For interacting with Discord. Sending messages, creating channels, guilds, etc. // To read object state such as guilds, State() should be used in stead. However some data // might not exist in the state. If so it should be requested. Note that this only holds http // CRUD operation and not the actual rest endpoints for discord (See Rest()). Req() httd.Requester // Event let's developers listen for specific events, event groups, or every event as one listener. // Supports both channels and callbacks Evt() EvtDispatcher // State reflects the latest changes received from Discord gateway. // Should be used instead of requesting objects. State() state.Cacher // RateLimiter the ratelimiter for the discord REST API RateLimiter() httd.RateLimiter // Discord Gateway, web socket // Connect() error Disconnect() error // event callbacks AddListener(evtName string, callback interface{}) AddListenerOnce(evtName string, callback interface{}) // all discord REST functions // TODO: support caching for each // Audit-log GetGuildAuditLogs(guildID Snowflake, params *rest.AuditLogParams) (log *resource.AuditLog, err error) // Channel GetChannel(id Snowflake) (ret *resource.Channel, err error) ModifyChannel(changes *rest.ModifyChannelParams) (ret *resource.Channel, err error) DeleteChannel(id Snowflake) (err error) EditChannelPermissions(chanID, overwriteID Snowflake, params *rest.EditChannelPermissionsParams) (err error) GetChannelInvites(id Snowflake) (ret []*resource.Invite, err error) CreateChannelInvites(id Snowflake, params *rest.CreateChannelInvitesParams) (ret *resource.Invite, err error) DeleteChannelPermission(channelID, overwriteID Snowflake) (err error) TriggerTypingIndicator(channelID Snowflake) (err error) GetPinnedMessages(channelID Snowflake) (ret []*resource.Message, err error) AddPinnedChannelMessage(channelID, msgID Snowflake) (err error) DeletePinnedChannelMessage(channelID, msgID Snowflake) (err error) GroupDMAddRecipient(channelID, userID Snowflake, params *rest.GroupDMAddRecipientParams) (err error) GroupDMRemoveRecipient(channelID, userID Snowflake) (err error) GetChannelMessages(channelID Snowflake, params rest.URLParameters) (ret []*resource.Message, err error) GetChannelMessage(channelID, messageID Snowflake) (ret *resource.Message, err error) CreateChannelMessage(channelID Snowflake, params *rest.CreateMessageParams) (ret *resource.Message, err error) EditMessage(chanID, msgID Snowflake, params *rest.EditMessageParams) (ret *resource.Message, err error) DeleteMessage(channelID, msgID Snowflake) (err error) BulkDeleteMessages(chanID Snowflake, params *rest.BulkDeleteMessagesParams) (err error) CreateReaction(channelID, messageID Snowflake, emoji interface{}) (ret *resource.Reaction, err error) DeleteOwnReaction(channelID, messageID Snowflake, emoji interface{}) (err error) DeleteUserReaction(channelID, messageID, userID Snowflake, emoji interface{}) (err error) GetReaction(channelID, messageID Snowflake, emoji interface{}, params rest.URLParameters) (ret []*resource.User, err error) DeleteAllReactions(channelID, messageID Snowflake) (err error) // Emoji GetGuildEmojis(id Snowflake) (ret []*resource.Emoji, err error) GetGuildEmoji(guildID, emojiID Snowflake) (ret *resource.Emoji, err error) CreateGuildEmoji(guildID Snowflake) (ret *resource.Emoji, err error) ModifyGuildEmoji(guildID, emojiID Snowflake) (ret *resource.Emoji, err error) DeleteGuildEmoji(guildID, emojiID Snowflake) (err error) // Guild CreateGuild(params *rest.CreateGuildParams) (ret *resource.Guild, err error) GetGuild(id Snowflake) (ret *resource.Guild, err error) ModifyGuild(id Snowflake, params *rest.ModifyGuildParams) (ret *resource.Guild, err error) DeleteGuild(id Snowflake) (err error) GetGuildChannels(id Snowflake) (ret []*resource.Channel, err error) CreateGuildChannel(id Snowflake, params *rest.CreateGuildChannelParams) (ret *resource.Channel, err error) GetGuildMember(guildID, userID Snowflake) (ret *resource.Member, err error) GetGuildMembers(guildID, after Snowflake, limit int) (ret []*resource.Member, err error) AddGuildMember(guildID, userID Snowflake, params *rest.AddGuildMemberParams) (ret *resource.Member, err error) ModifyGuildMember(guildID, userID Snowflake, params *rest.ModifyGuildMemberParams) (err error) ModifyCurrentUserNick(id Snowflake, params *rest.ModifyCurrentUserNickParams) (nick string, err error) AddGuildMemberRole(guildID, userID, roleID Snowflake) (err error) RemoveGuildMemberRole(guildID, userID, roleID Snowflake) (err error) RemoveGuildMember(guildID, userID Snowflake) (err error) GetGuildBans(id Snowflake) (ret []*resource.Ban, err error) GetGuildBan(guildID, userID Snowflake) (ret *resource.Ban, err error) CreateGuildBan(guildID, userID Snowflake, params *rest.CreateGuildBanParams) (err error) RemoveGuildBan(guildID, userID Snowflake) (err error) GetGuildRoles(guildID Snowflake) (ret []*resource.Role, err error) CreateGuildRole(id Snowflake, params *rest.CreateGuildRoleParams) (ret *resource.Role, err error) ModifyGuildRolePositions(guildID Snowflake, params *rest.ModifyGuildRolePositionsParams) (ret []*resource.Role, err error) ModifyGuildRole(guildID, roleID Snowflake, params *rest.ModifyGuildRoleParams) (ret []*resource.Role, err error) DeleteGuildRole(guildID, roleID Snowflake) (err error) GetGuildPruneCount(id Snowflake, params *rest.GuildPruneParams) (ret *resource.GuildPruneCount, err error) BeginGuildPrune(id Snowflake, params *rest.GuildPruneParams) (ret *resource.GuildPruneCount, err error) GetGuildVoiceRegions(id Snowflake) (ret []*resource.VoiceRegion, err error) GetGuildInvites(id Snowflake) (ret []*resource.Invite, err error) GetGuildIntegrations(id Snowflake) (ret []*resource.Integration, err error) CreateGuildIntegration(guildID Snowflake, params *rest.CreateGuildIntegrationParams) (err error) ModifyGuildIntegration(guildID, integrationID Snowflake, params *rest.ModifyGuildIntegrationParams) (err error) DeleteGuildIntegration(guildID, integrationID Snowflake) (err error) SyncGuildIntegration(guildID, integrationID Snowflake) (err error) GetGuildEmbed(guildID Snowflake) (ret *resource.GuildEmbed, err error) ModifyGuildEmbed(guildID Snowflake, params *resource.GuildEmbed) (ret *resource.GuildEmbed, err error) GetGuildVanityURL(guildID Snowflake) (ret *resource.PartialInvite, err error) // Invite GetInvite(inviteCode string, withCounts bool) (invite *resource.Invite, err error) DeleteInvite(inviteCode string) (invite *resource.Invite, err error) // User GetCurrentUser() (ret *resource.User, err error) GetUser(id Snowflake) (ret *resource.User, err error) ModifyCurrentUser(params *rest.ModifyCurrentUserParams) (ret *resource.User, err error) GetCurrentUserGuilds(params *rest.GetCurrentUserGuildsParams) (ret []*resource.Guild, err error) LeaveGuild(id Snowflake) (err error) GetUserDMs() (ret []*resource.Channel, err error) CreateDM(recipientID Snowflake) (ret *resource.Channel, err error) CreateGroupDM(params *rest.CreateGroupDMParams) (ret *resource.Channel, err error) GetUserConnections() (ret []*resource.UserConnection, err error) // Voice GetVoiceRegions() (ret []*resource.VoiceRegion, err error) // Webhook CreateWebhook(channelID Snowflake, params *rest.CreateWebhookParams) (ret *resource.Webhook, err error) GetChannelWebhooks(channelID Snowflake) (ret []*resource.Webhook, err error) GetGuildWebhooks(guildID Snowflake) (ret []*resource.Webhook, err error) GetWebhook(id Snowflake) (ret *resource.Webhook, err error) GetWebhookWithToken(id Snowflake, token string) (ret *resource.Webhook, err error) ModifyWebhook(newWebhook *resource.Webhook) (ret *resource.Webhook, err error) ModifyWebhookWithToken(newWebhook *resource.Webhook) (ret *resource.Webhook, err error) DeleteWebhook(webhookID Snowflake) (err error) DeleteWebhookWithToken(id Snowflake, token string) (err error) ExecuteWebhook(params *rest.ExecuteWebhookParams, wait bool, URLSuffix string) (err error) ExecuteSlackWebhook(params *rest.ExecuteWebhookParams, wait bool) (err error) ExecuteGitHubWebhook(params *rest.ExecuteWebhookParams, wait bool) (err error) // same as above. Except these returns a channel // WARNING: none below should be assumed to be working. GuildChan(guildID Snowflake) <-chan *resource.Guild ChannelChan(channelID Snowflake) <-chan *resource.Channel ChannelsChan(guildID Snowflake) <-chan map[Snowflake]*resource.Channel MsgChan(msgID Snowflake) <-chan *resource.Message UserChan(userID Snowflake) <-chan *UserChan MemberChan(guildID, userID Snowflake) <-chan *resource.Member MembersChan(guildID Snowflake) <-chan map[Snowflake]*resource.Member }
Session the discord api is split in two. socket for keeping the client up to date, and http api for requests.
func NewSession ¶
func NewSessionMustCompile ¶
type TypingStartCallback ¶
type TypingStartCallback = func(session Session, ts *TypingStartBox)
typing start
type UserUpdateCallback ¶
type UserUpdateCallback = func(session Session, uu *UserUpdateBox)
user update
type VoiceServerUpdateCallback ¶
type VoiceServerUpdateCallback = func(session Session, vsu *VoiceServerUpdateBox)
type VoiceStateUpdateCallback ¶
type VoiceStateUpdateCallback = func(session Session, vsu *VoiceStateUpdateBox)
voice
type WebhooksUpdateCallback ¶
type WebhooksUpdateCallback = func(session Session, wu *WebhooksUpdateBox)
webhook
Source Files ¶
Click to show internal directories.
Click to hide internal directories.