Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Join = &framework.Command{ Name: "join", PermissionRequired: 0, Exec: func(ctx *framework.Context) error { channel, err := ctx.GetSenderVoiceChannel() optionalVCId := ctx.GetArgIndexDefault(0, "") if len(optionalVCId) > 0 { err = ctx.Hanamaru.VoiceContext.JoinChannel(ctx.Hanamaru.Session, ctx.GuildID, optionalVCId, ctx.ChannelID) if err != nil { return err } } if err != nil { return err } err = ctx.Hanamaru.VoiceContext.JoinChannel(ctx.Hanamaru.Session, ctx.GuildID, channel.ID, ctx.ChannelID) if err != nil { return err } return nil }, }
View Source
var Leave = &framework.Command{ Name: "leave", PermissionRequired: 0, Exec: func(ctx *framework.Context) error { channel, err := ctx.GetSenderVoiceChannel() if err != nil { return err } err = ctx.Hanamaru.VoiceContext.LeaveChannel(ctx.GuildID, channel.ID) if err != nil { return err } return nil }, }
View Source
var Play = &framework.Command{ Name: "play", PermissionRequired: 0, Exec: func(ctx *framework.Context) error { _, ok := ctx.Hanamaru.VoiceContext.VCs[ctx.GuildID] if !ok { return fmt.Errorf("cannot play when im not connected") } queueChan, ok := ctx.Hanamaru.VoiceContext.QueueChannels[ctx.GuildID] if !ok { return fmt.Errorf("this isnt supposed to happen wot") } videoUrl, err := ctx.GetArgIndex(0) if err != nil { return errors.New("please pass in a valid video URL") } queueChan <- voice.NewYTSrc(videoUrl, ctx.Hanamaru.VoiceContext.Ytdl) return nil }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.