Documentation ¶
Index ¶
- Constants
- Variables
- func ContainsString(slice []string, key string, ignoreCase bool) bool
- func CurrentTimeMillis() int64
- func EqualsString(string1, string2 string, ignoreCase bool) bool
- func FormattedTime() string
- func IsConnectionFailure(err error) bool
- func KeepAlive()
- func Print(level LogLevel, action LogAction, message string, v ...interface{})
- func TrimString(content string) string
- type BotApplication
- type DiscordListener
- type EventType
- type LogAction
- type LogLevel
- type LogPrinter
- type Permission
- type PlainBotApplication
- func (plain *PlainBotApplication) ForceSession() *discordgo.Session
- func (plain *PlainBotApplication) GetEmitter() *eventemitter.Emitter
- func (plain *PlainBotApplication) GetProps() Props
- func (plain *PlainBotApplication) GetSharding() Sharding
- func (plain *PlainBotApplication) GetToken() string
- func (plain *PlainBotApplication) IsConnected() bool
- func (plain *PlainBotApplication) ListenDiscordEvent(eventType EventType, listener DiscordListener)
- func (plain *PlainBotApplication) ListenEvent(eventType eventemitter.EventType, listener eventemitter.HandleFunc)
- func (plain *PlainBotApplication) OpenConnection(configurator SessionConfigurator) (*discordgo.Session, error)
- func (plain *PlainBotApplication) PublishDiscordEvent(session *discordgo.Session, event interface{})
- func (plain *PlainBotApplication) PublishEvent(eventType eventemitter.EventType, arguments ...interface{})
- func (plain *PlainBotApplication) Session() (*discordgo.Session, error)
- func (plain *PlainBotApplication) TestAttributes()
- type PlainProps
- func (plain *PlainProps) FilterProperties(filter PropertyFilter) []interface{}
- func (plain *PlainProps) GetMap() Properties
- func (plain *PlainProps) GetProperty(property string) (interface{}, error)
- func (plain *PlainProps) GetPropertyOrDefault(property string, alternative interface{}) interface{}
- func (plain *PlainProps) HasProperty(property string) bool
- func (plain *PlainProps) RemoveProperty(property string)
- func (plain *PlainProps) SetProperties(props Properties)
- func (plain *PlainProps) SetProperty(property string, value interface{})
- type PlainSharding
- type Properties
- type PropertyFilter
- type Props
- type SessionConfigurator
- type Sharding
Constants ¶
View Source
const ( EventTypeEvent = EventType("discordgo.Event") EventTypeReady = EventType("discordgo.Ready") EventTypeChannelCreate = EventType("discordgo.ChannelCreate") EventTypeChannelUpdate = EventType("discordgo.ChannelUpdate") EventTypeChannelDelete = EventType("discordgo.ChannelDelete") EventTypeChannelPinsUpdate = EventType("discordgo.ChannelPinsUpdate") EventTypeGuildCreate = EventType("discordgo.GuildCreate") EventTypeGuildUpdate = EventType("discordgo.GuildUpdate") EventTypeGuildDelete = EventType("discordgo.GuildDelete") EventTypeGuildBanAdd = EventType("discordgo.GuildBanAdd") EventTypeGuildBanRemove = EventType("discordgo.GuildBanRemove") EventTypeGuildMemberAdd = EventType("discordgo.GuildMemberAdd") EventTypeGuildMemberUpdate = EventType("discordgo.GuildMemberUpdate") EventTypeGuildMemberRemove = EventType("discordgo.GuildMemberRemove") EventTypeGuildRoleCreate = EventType("discordgo.GuildRoleCreate") EventTypeGuildRoleUpdate = EventType("discordgo.GuildRoleUpdate") EventTypeGuildRoleDelete = EventType("discordgo.GuildRoleDelete") EventTypeGuildEmojisUpdate = EventType("discordgo.GuildEmojisUpdate") EventTypeGuildMembersChunk = EventType("discordgo.GuildMembersChunk") EventTypeGuildIntegrationsUpdate = EventType("discordgo.GuildIntegrationsUpdate") EventTypeMessageAck = EventType("discordgo.MessageAck") EventTypeMessageCreate = EventType("discordgo.MessageCreate") EventTypeMessageUpdate = EventType("discordgo.MessageUpdate") EventTypeMessageDelete = EventType("discordgo.MessageDelete") EventTypeMessageReactionAdd = EventType("discordgo.MessageReactionAdd") EventTypeMessageReactionRemove = EventType("discordgo.MessageReactionRemove") EventTypeMessageReactionRemoveAll = EventType("discordgo.MessageReactionRemoveAll") EventTypePresencesReplace = EventType("discordgo.PresencesReplace") EventTypePresenceUpdate = EventType("discordgo.PresenceUpdate") EventTypeResumed = EventType("discordgo.Resumed") EventTypeRelationshipAdd = EventType("discordgo.RelationshipAdd") EventTypeRelationshipRemove = EventType("discordgo.RelationshipRemove") EventTypeTypingStart = EventType("discordgo.TypingStart") EventTypeUserUpdate = EventType("discordgo.UserUpdate") EventTypeUserSettingsUpdate = EventType("discordgo.UserSettingsUpdate") EventTypeUserGuildSettingsUpdate = EventType("discordgo.UserGuildSettingsUpdate") EventTypeUserNoteUpdate = EventType("discordgo.UserNoteUpdate") EventTypeVoiceServerUpdate = EventType("discordgo.VoiceServerUpdate") EventTypeVoiceStateUpdate = EventType("discordgo.VoiceStateUpdate") EventTypeVoiceStatMessageDeleteBulkeUpdate = EventType("discordgo.MessageDeleteBulk") EventTypeWebhooksUpdate = EventType("discordgo.WebhooksUpdate") )
noinspection ALL
Variables ¶
View Source
var ( LogLevelInfo = LogLevel{Prefix: "INFO"} LogLevelDebug = LogLevel{Prefix: "DEBUG"} LogLevelWarn = LogLevel{Prefix: "WARN"} LogLevelFatal = LogLevel{Prefix: "FATAL", Printer: func(out string) { fmt.Print(out) os.Exit(1) }} LogLevelPanic = LogLevel{Prefix: "PANIC", Printer: func(out string) { panic(out) }} )
noinspection GoUnusedGlobalVariable
Functions ¶
func CurrentTimeMillis ¶
func CurrentTimeMillis() int64
func EqualsString ¶
func FormattedTime ¶
func FormattedTime() string
func IsConnectionFailure ¶
func TrimString ¶
Types ¶
type BotApplication ¶
type BotApplication interface { GetToken() string GetSharding() Sharding GetProps() Props GetEmitter() *eventemitter.Emitter PublishEvent(eventType eventemitter.EventType, arguments ...interface{}) PublishDiscordEvent(session *discordgo.Session, event interface{}) ListenEvent(eventType eventemitter.EventType, listener eventemitter.HandleFunc) ListenDiscordEvent(eventType EventType, listener DiscordListener) TestAttributes() OpenConnection(configurator SessionConfigurator) (*discordgo.Session, error) IsConnected() bool Session() (*discordgo.Session, error) ForceSession() *discordgo.Session }
func NewBotApplication ¶
func NewBotApplication(token string) BotApplication
type DiscordListener ¶
type DiscordListener = func(application BotApplication, session *discordgo.Session, event interface{})
type LogLevel ¶
type LogLevel struct { Prefix string Printer LogPrinter }
type LogPrinter ¶
type LogPrinter func(out string)
type Permission ¶
type Permission int
func (Permission) HasPermission ¶
func (permission Permission) HasPermission(session *discordgo.Session, userID, channelID string) bool
type PlainBotApplication ¶
type PlainBotApplication struct { BotApplication Token string Sharding Sharding EventEmitter *eventemitter.Emitter Props Props // contains filtered or unexported fields }
func (*PlainBotApplication) ForceSession ¶
func (plain *PlainBotApplication) ForceSession() *discordgo.Session
func (*PlainBotApplication) GetEmitter ¶
func (plain *PlainBotApplication) GetEmitter() *eventemitter.Emitter
func (*PlainBotApplication) GetProps ¶
func (plain *PlainBotApplication) GetProps() Props
func (*PlainBotApplication) GetSharding ¶
func (plain *PlainBotApplication) GetSharding() Sharding
func (*PlainBotApplication) GetToken ¶
func (plain *PlainBotApplication) GetToken() string
func (*PlainBotApplication) IsConnected ¶
func (plain *PlainBotApplication) IsConnected() bool
func (*PlainBotApplication) ListenDiscordEvent ¶
func (plain *PlainBotApplication) ListenDiscordEvent(eventType EventType, listener DiscordListener)
func (*PlainBotApplication) ListenEvent ¶
func (plain *PlainBotApplication) ListenEvent(eventType eventemitter.EventType, listener eventemitter.HandleFunc)
func (*PlainBotApplication) OpenConnection ¶
func (plain *PlainBotApplication) OpenConnection(configurator SessionConfigurator) (*discordgo.Session, error)
func (*PlainBotApplication) PublishDiscordEvent ¶
func (plain *PlainBotApplication) PublishDiscordEvent(session *discordgo.Session, event interface{})
func (*PlainBotApplication) PublishEvent ¶
func (plain *PlainBotApplication) PublishEvent(eventType eventemitter.EventType, arguments ...interface{})
func (*PlainBotApplication) Session ¶
func (plain *PlainBotApplication) Session() (*discordgo.Session, error)
func (*PlainBotApplication) TestAttributes ¶
func (plain *PlainBotApplication) TestAttributes()
type PlainProps ¶
type PlainProps struct {
Properties Properties
}
func (*PlainProps) FilterProperties ¶
func (plain *PlainProps) FilterProperties(filter PropertyFilter) []interface{}
func (*PlainProps) GetMap ¶
func (plain *PlainProps) GetMap() Properties
func (*PlainProps) GetProperty ¶
func (plain *PlainProps) GetProperty(property string) (interface{}, error)
func (*PlainProps) GetPropertyOrDefault ¶
func (plain *PlainProps) GetPropertyOrDefault(property string, alternative interface{}) interface{}
func (*PlainProps) HasProperty ¶
func (plain *PlainProps) HasProperty(property string) bool
func (*PlainProps) RemoveProperty ¶
func (plain *PlainProps) RemoveProperty(property string)
func (*PlainProps) SetProperties ¶
func (plain *PlainProps) SetProperties(props Properties)
func (*PlainProps) SetProperty ¶
func (plain *PlainProps) SetProperty(property string, value interface{})
type PlainSharding ¶
func (*PlainSharding) GetCount ¶
func (plain *PlainSharding) GetCount() int
func (*PlainSharding) GetID ¶
func (plain *PlainSharding) GetID() int
type Properties ¶
type Properties map[string]interface{}
type PropertyFilter ¶
type Props ¶
type Props interface { GetMap() Properties FilterProperties(filter PropertyFilter) []interface{} HasProperty(property string) bool GetProperty(property string) (interface{}, error) GetPropertyOrDefault(property string, alternative interface{}) interface{} SetProperty(property string, value interface{}) SetProperties(props Properties) RemoveProperty(property string) }
func NewProps ¶
func NewProps(values Properties) Props
type SessionConfigurator ¶
type SessionConfigurator = func(application BotApplication, session *discordgo.Session)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.