Versions in this module Expand all Collapse all v24 v24.0.0 Sep 29, 2022 Changes in this version + var ErrBadData = errors.New("bad data") + var ErrMissingData = errors.New("missing data") + var ErrNotFound = errors.New("not found") + type Channel struct + func ChannelFromElement(e etfapi.Element) (Channel, error) + func ChannelFromElementMap(eMap map[string]etfapi.Element) (Channel, error) + func (c *Channel) ID() snowflake.Snowflake + func (c *Channel) UpdateFromElementMap(eMap map[string]etfapi.Element) error + type ChannelType int + const DMChannel + const GroupDMChannel + const GuildCategoryChannel + const GuildTextChannel + const GuildVoiceChannel + func ChannelTypeFromElement(e etfapi.Element) (ChannelType, error) + func (t ChannelType) String() string + type Guild struct + func GuildFromElement(e etfapi.Element) (Guild, error) + func GuildFromElementMap(eMap map[string]etfapi.Element) (Guild, error) + func (g *Guild) AllAdministratorRoleIDs() []snowflake.Snowflake + func (g *Guild) ChannelWithName(name string) (snowflake.Snowflake, bool) + func (g *Guild) HasRole(uid, rid snowflake.Snowflake) bool + func (g *Guild) ID() snowflake.Snowflake + func (g *Guild) IsAdmin(uid snowflake.Snowflake) bool + func (g *Guild) OwnsChannel(cid snowflake.Snowflake) bool + func (g *Guild) RoleIsAdministrator(rid snowflake.Snowflake) bool + func (g *Guild) RoleWithName(name string) (snowflake.Snowflake, bool) + func (g *Guild) UpdateFromElementMap(eMap map[string]etfapi.Element) error + func (g *Guild) UpsertMemberFromElementMap(eMap map[string]etfapi.Element) (GuildMember, error) + func (g *Guild) UpsertRoleFromElementMap(eMap map[string]etfapi.Element) (Role, error) + type GuildMember struct + func GuildMemberFromElement(e etfapi.Element) (GuildMember, error) + func (m *GuildMember) UpdateFromElementMap(eMap map[string]etfapi.Element) error + type Role struct + func RoleFromElement(e etfapi.Element) (Role, error) + func (r *Role) IsAdmin() bool + func (r *Role) UpdateFromElementMap(eMap map[string]etfapi.Element) error + type Session struct + func NewSession() *Session + func (s *Session) ChannelName(cid snowflake.Snowflake) (string, bool) + func (s *Session) Guild(gid snowflake.Snowflake) (Guild, bool) + func (s *Session) GuildIDs() []snowflake.Snowflake + func (s *Session) GuildOfChannel(cid snowflake.Snowflake) (snowflake.Snowflake, bool) + func (s *Session) ID() string + func (s *Session) IsGuildAdmin(gid, uid snowflake.Snowflake) bool + func (s *Session) UpdateFromReady(data map[string]etfapi.Element) error + func (s *Session) UpsertChannelFromElement(e etfapi.Element) (snowflake.Snowflake, error) + func (s *Session) UpsertChannelFromElementMap(eMap map[string]etfapi.Element) (snowflake.Snowflake, snowflake.Snowflake, error) + func (s *Session) UpsertGuildFromElement(e etfapi.Element) (snowflake.Snowflake, error) + func (s *Session) UpsertGuildFromElementMap(eMap map[string]etfapi.Element) (snowflake.Snowflake, error) + func (s *Session) UpsertGuildMemberFromElementMap(eMap map[string]etfapi.Element) (snowflake.Snowflake, error) + func (s *Session) UpsertGuildRoleFromElementMap(eMap map[string]etfapi.Element) (snowflake.Snowflake, error) + type User struct + func UserFromElement(e etfapi.Element) (User, error) + func (u *User) UpdateFromElementMap(eMap map[string]etfapi.Element) error Other modules containing this package github.com/gsmcwhirter/discord-bot-lib/v19 github.com/gsmcwhirter/discord-bot-lib/v20 github.com/gsmcwhirter/discord-bot-lib/v21 github.com/gsmcwhirter/discord-bot-lib/v22 github.com/gsmcwhirter/discord-bot-lib/v23