state

package
v0.0.0-...-905ac89 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2018 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrStateNotFound = errors.New("shared state cache not found")

ErrStateNotFound will be returned if the item was not found in the shared state

View Source
var ErrTargetWrongServer = errors.New("target is on wrong server")

ErrTargetWrongServer will be returned if the target is on the wrong server

View Source
var ErrTargetWrongType = errors.New("target is on wrong server")

ErrTargetWrongType will be returned if the target is on the wrong server

Functions

func AllChannelIDs

func AllChannelIDs() (guildIDs []string, err error)

AllChannelIDs returns a list of all Channel IDs from the shared state

func AllGuildIDs

func AllGuildIDs() (guildIDs []string, err error)

AllGuildIDs returns a list of all Guild IDs from the shared state

func AllUserIDs

func AllUserIDs() (userIDs []string, err error)

AllUserIDs returns a list of all User IDs from the shared state

func BotIDForGuild

func BotIDForGuild(guildID string) (botID string, err error)

BotIDForGuild returns a Bot User ID for the given Guild ID

func Channel

func Channel(channelID string) (channel *discordgo.Channel, err error)

Channel returns the specified Channel from the shard state, returns ErrStateNotFound if not found

func ChannelFromMention

func ChannelFromMention(guildID string, mention string) (*discordgo.Channel, error)

ChannelFromMention finds a text channel on the same server in an mention, can be direct ID input

func ChannelMessages

func ChannelMessages(channelID string) (messages []discordgo.Message, err error)

ChannelMessages returns the messages of a channel

func Emoji

func Emoji(guildID, emojiID string) (emoji *discordgo.Emoji, err error)

Emoji returns the specified Emoji from the shard state, returns ErrStateNotFound if not found

func Guild

func Guild(guildID string) (guild *discordgo.Guild, err error)

Guild returns the specified Guild from the shard state, returns ErrStateNotFound if not found

func GuildBannedUserIDs

func GuildBannedUserIDs(guildID string) (userIDs []string, err error)

GuildBannedUserIDs returns the banned user of a server only contains items if the bot has the Ban Members or Administrator permission

func GuildUserIDs

func GuildUserIDs(guildID string) (userIDs []string, err error)

GuildUserIDs returns a list of all User IDs in a specific Guild from the shared state

func IsMember

func IsMember(guildID, userID string) (isMember bool, err error)

IsMember true if the User is a member of the specified Guild

func Member

func Member(guildID, userID string) (member *discordgo.Member, err error)

Member returns the specified Member from the shard state, returns ErrStateNotFound if not found

func Presence

func Presence(guildID, userID string) (presence *discordgo.Presence, err error)

Presence returns the specified Presence from the shard state, returns ErrStateNotFound if not found

func Role

func Role(guildID, roleID string) (role *discordgo.Role, err error)

Role returns the specified Role from the shard state, returns ErrStateNotFound if not found

func SharedStateEventHandler

func SharedStateEventHandler(session *discordgo.Session, i interface{}) error

SharedStateEventHandler receives events from a discordgo Websocket and updates the shared state with them

func User

func User(userID string) (user *discordgo.User, err error)

User returns the specified User from the shard state, returns ErrStateNotFound if not found

func UserChannelPermissions

func UserChannelPermissions(userID, channelID string) (apermissions int, err error)

UserChannelPermissions returns the permission of a user in a channel

func UserFromMention

func UserFromMention(mention string) (*discordgo.User, error)

UserFromMention finds an user in a mention, can be direct ID input

func UserPermissions

func UserPermissions(userID, guildID string) (apermissions int, err error)

UserPermissions returns the permissions of a user in a guild

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL