Documentation ¶
Index ¶
- type MemberStore
- func (s *MemberStore) Each(g discord.GuildID, fn func(*discord.Member) (stop bool)) error
- func (s *MemberStore) Member(guildID discord.GuildID, userID discord.UserID) (*discord.Member, error)
- func (s *MemberStore) MemberRemove(guildID discord.GuildID, userID discord.UserID) error
- func (s *MemberStore) MemberSet(guildID discord.GuildID, member discord.Member) error
- func (s *MemberStore) Members(guildID discord.GuildID) ([]discord.Member, error)
- func (s *MemberStore) Reset() error
- type PresenceStore
- func (pres *PresenceStore) Each(g discord.GuildID, fn func(*gateway.Presence) (stop bool))
- func (pres *PresenceStore) Presence(guild discord.GuildID, user discord.UserID) (*gateway.Presence, error)
- func (pres *PresenceStore) PresenceRemove(guild discord.GuildID, user discord.UserID) error
- func (pres *PresenceStore) PresenceSet(guild discord.GuildID, p gateway.Presence) error
- func (pres *PresenceStore) Presences(guild discord.GuildID) ([]gateway.Presence, error)
- func (pres *PresenceStore) Reset() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MemberStore ¶
type MemberStore struct {
// contains filtered or unexported fields
}
func NewMemberStore ¶
func NewMemberStore() *MemberStore
func (*MemberStore) Each ¶
Each iterates over all members of the guild in undefined order. The given callback must not store the pointer outside of the callback; it must do so after making its own copy.
func (*MemberStore) MemberRemove ¶
func (*MemberStore) Reset ¶
func (s *MemberStore) Reset() error
type PresenceStore ¶
type PresenceStore struct {
// contains filtered or unexported fields
}
PresenceStore is a presence store that allows searching for a user presence regardless of the guild they're from.
func NewPresenceStore ¶
func NewPresenceStore() *PresenceStore
func (*PresenceStore) Each ¶
Each iterates over all presences in undefined order. If a valid guild ID is given, then the presence passed into the callback will be from that guild if available. Otherwise, a fallback is given.
A read mutex is acquired, so the given callback is allowed to call PresenceStore's Presence and Presences methods. The given callback must not store the pointer outside of the callback; it must do so after making its own copy.
func (*PresenceStore) PresenceRemove ¶
func (*PresenceStore) PresenceSet ¶
func (*PresenceStore) Presences ¶
Presences creates a copy of all known presences. It is a fairly costly copy, so Each should be preferred over Presences. The only reason this method does what is intended is for compatibility with internal state functions that may rely on this for some reason.
func (*PresenceStore) Reset ¶
func (pres *PresenceStore) Reset() error