bot

package
v0.0.0-...-df66f8c Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SoundsChannel   string = "sounds"
	CommandsChannel string = "bot-commands"
)

Variables

View Source
var Token string

Functions

func PlayAudioFile

func PlayAudioFile(d *discordgo.Session, guildID string, v *discordgo.VoiceConnection, sound *Sound)

PlayAudioFile modified sample from github.com/jonas747/dca

func Run

func Run()

Types

type Channels

type Channels struct {
	VoiceChannels []VoiceChannel `json:"voiceChannels"`
}

type Command

type Command string
const (
	PlaySound   Command = ",s"
	SkipSound   Command = ",ss"
	Connect     Command = ",connect"
	Help        Command = ",help"
	List        Command = ",list"
	Rename      Command = ",rename"
	AddEntrance Command = ",addentrance"
	Adjustvol   Command = ",adjustvol"
	Find        Command = ",f"
)

type Entrances

type Entrances map[string]*Sound

Entrances [UserID]

type GlobalStore

type GlobalStore map[string]*GuildState

GlobalStore Store [guildID]

type GuildState

type GuildState struct {
	SoundList       SoundList  `json:"soundList"`
	Entrances       Entrances  `json:"entrances"`
	Channels        Channels   `json:"channels"`
	SoundsChannelID string     `json:"soundsChannelID"`
	Mutex           sync.Mutex `json:"-"`
	StopPlayback    chan bool  `json:"-"`
}

type Sound

type Sound struct {
	MessageID string `json:"messageId"`
	URL       string `json:"url"`
	Volume    int    `json:"volume"`
}

type SoundList

type SoundList map[string]*Sound

SoundList [SoundName]

type VoiceChannel

type VoiceChannel struct {
	ID             string
	GuildID        string
	Name           string
	UsersConnected []discordgo.User
}

Jump to

Keyboard shortcuts

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