Documentation ¶
Index ¶
- type Client
- func (c *Client) Channel(channelID string) (*dg.Channel, error)
- func (c *Client) Guild(guildID string) (*dg.Guild, error)
- func (c *Client) Member(guildID, userID string) (*dg.Member, error)
- func (c *Client) MemberAllowed(guildID, userID string, perms int64) (bool, error)
- func (c *Client) Role(guildID, roleID string) (*dg.Role, error)
- func (c *Client) VoiceJoin(guildID, userID string) (*dg.VoiceConnection, error)
- func (c *Client) VoiceState(guildID, userID string) (*dg.VoiceState, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
func (*Client) Channel ¶
Channel returns a channel based on the specific channel ID. Tries to use the local cache, if that fails, makes an API call.
func (*Client) Guild ¶
Guild returns a guild based on the specific guild ID. Tries to use the local cache, if that fails, makes an API call.
func (*Client) Member ¶
Member returns a guild's member based on the specific guild and user IDs. Tries to use the local cache, if that fails, makes an API call.
func (*Client) MemberAllowed ¶
MemberAllowed returns true iff:
- guildID is empty (aka a DM)
- all the user's roles, combined as one, have all permissions in the perms bitfield
- any of the user's roles has the administrator permission
- the user is the owner of the guild
func (*Client) Role ¶
Role returns a role based on the specific guild and role IDs. Tries to use the local cache, if that fails, makes an API call.
func (*Client) VoiceJoin ¶
func (c *Client) VoiceJoin(guildID, userID string) (*dg.VoiceConnection, error)
VoiceJoin joins the same voice channel in guild as user.
func (*Client) VoiceState ¶
func (c *Client) VoiceState(guildID, userID string) (*dg.VoiceState, error)
VoiceState returns a voice state by guild and user ID. Tries to use the local cache, if that fails, makes an API call.