Documentation ¶
Index ¶
- Constants
- type CmdMap
- type Command
- type CommandHandler
- type CommandStruct
- type Config
- type Connection
- type Context
- type JoinProperties
- type PlaylistVideo
- type Session
- type SessionManager
- func (manager SessionManager) GetByChannel(channelId string) (*Session, bool)
- func (manager SessionManager) GetByGuild(guildId string) *Session
- func (manager *SessionManager) Join(discord *discordgo.Session, guildId, channelId string, ...) (*Session, error)
- func (manager *SessionManager) Leave(discord *discordgo.Session, session Session)
- type Song
- type SongQueue
- func (queue *SongQueue) Add(song Song)
- func (queue *SongQueue) Clear()
- func (queue *SongQueue) Current() *Song
- func (queue SongQueue) Get() []Song
- func (queue SongQueue) HasNext() bool
- func (queue *SongQueue) Next() Song
- func (queue *SongQueue) Pause()
- func (queue *SongQueue) Set(list []Song)
- func (queue *SongQueue) Start(sess *Session, callback func(string))
- type VideoResult
- type Youtube
Constants ¶
View Source
const ( CHANNELS int = 2 FRAME_RATE int = 48000 FRAME_SIZE int = 960 MAX_BYTES int = (FRAME_SIZE * 2) * 2 )
View Source
const ( ERROR_TYPE = -1 VIDEO_TYPE = 0 PLAYLIST_TYPE = 1 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CmdMap ¶
type CmdMap map[string]CommandStruct
type CommandHandler ¶
type CommandHandler struct {
// contains filtered or unexported fields
}
func NewCommandHandler ¶
func NewCommandHandler() *CommandHandler
func (CommandHandler) GetCmds ¶
func (handler CommandHandler) GetCmds() CmdMap
type CommandStruct ¶
type CommandStruct struct {
// contains filtered or unexported fields
}
func (CommandStruct) GetHelp ¶
func (command CommandStruct) GetHelp() string
type Config ¶
type Config struct { Prefix string `json:"prefix"` ServiceUrl string `json:"service_url"` BotToken string `json:"bot_token"` OwnerId string `json:"owner_id"` UseSharding bool `json:"use_sharding"` ShardId int `json:"shard_id"` ShardCount int `json:"shard_count"` DefaultStatus string `json:"default_status"` }
func LoadConfig ¶
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
func NewConnection ¶
func NewConnection(voiceConnection *discordgo.VoiceConnection) *Connection
func (Connection) Disconnect ¶
func (connection Connection) Disconnect()
func (*Connection) Stop ¶
func (connection *Connection) Stop()
type Context ¶
type Context struct { Discord *discordgo.Session Guild *discordgo.Guild VoiceChannel *discordgo.Channel TextChannel *discordgo.Channel User *discordgo.User Message *discordgo.MessageCreate Args []string // dependency injection? Conf *Config CmdHandler *CommandHandler Sessions *SessionManager Youtube *Youtube }
func NewContext ¶
func NewContext(discord *discordgo.Session, guild *discordgo.Guild, textChannel *discordgo.Channel, user *discordgo.User, message *discordgo.MessageCreate, conf *Config, cmdHandler *CommandHandler, sessions *SessionManager, youtube *Youtube) *Context
func (*Context) GetVoiceChannel ¶
type JoinProperties ¶
type PlaylistVideo ¶
type PlaylistVideo struct {
Id string `json:"id"`
}
type SessionManager ¶
type SessionManager struct {
// contains filtered or unexported fields
}
func NewSessionManager ¶
func NewSessionManager() *SessionManager
func (SessionManager) GetByChannel ¶
func (manager SessionManager) GetByChannel(channelId string) (*Session, bool)
func (SessionManager) GetByGuild ¶
func (manager SessionManager) GetByGuild(guildId string) *Session
func (*SessionManager) Join ¶
func (manager *SessionManager) Join(discord *discordgo.Session, guildId, channelId string, properties JoinProperties) (*Session, error)
type VideoResult ¶
Click to show internal directories.
Click to hide internal directories.