ceviord

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2022 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const DiscordPostLenLimit = 2000

Variables

View Source
var Cache = Ceviord{
	Channels: Channels{},
	// contains filtered or unexported fields
}

Functions

func FindJoinedVC

func FindJoinedVC(s *discordgo.Session, guildId, authorId string) *discordgo.Channel

func MessageCreate

func MessageCreate(sess *discordgo.Session, msg *discordgo.MessageCreate)

MessageCreate will be called (due to AddHandler above) every time a new message is created on any channel that the authenticated bot has access to.

func RawSpeak

func RawSpeak(text string, guildId string, sess *discordgo.Session) error

func SendEmbedMsg

func SendEmbedMsg(embed *discordgo.MessageEmbed, session *discordgo.Session, guildId string) error

func SendMsg

func SendMsg(msg string, session *discordgo.Session, guildId string) error

func SetDbController

func SetDbController(r replace.DbController)

func SetNewTalker

func SetNewTalker(wav CevioWav)

func SetParam

func SetParam(param *Param)

Types

type Auth

type Auth struct {
	CeviordConn Conn `yaml:"conn"`
}

type CevioWav

type CevioWav interface {
	OutputWaveToFile(talkWord, path string) (err error)
	ApplyEmotions(param *Parameter) (err error)
}

type Ceviord

type Ceviord struct {
	Channels Channels

	Param *Param
	Auth  *Auth
	// contains filtered or unexported fields
}

type Channel

type Channel struct {
	PickedChannel string
	VoiceConn     *discordgo.VoiceConnection
	CurrentParam  *Parameter

	DictController replace.DbController
	// contains filtered or unexported fields
}

func (Channel) IsActorJoined

func (c Channel) IsActorJoined(sess *discordgo.Session) (bool, error)

type Channels

type Channels map[string]*Channel

func (Channels) AddChannel

func (cs Channels) AddChannel(c Channel, guildId string)

func (Channels) DeleteChannel

func (cs Channels) DeleteChannel(guildId string) error

func (Channels) GetChannel

func (cs Channels) GetChannel(guildId string) (*Channel, error)

func (Channels) IsExistChannel

func (cs Channels) IsExistChannel(guildId string) bool

type Conn

type Conn struct {
	Discord string `yaml:"discord"`
	Cevio   struct {
		Token    string `yaml:"cevioToken"`
		EndPoint string `yaml:"cevioEndPoint"`
	} `yaml:",inline"`
	DB DB `yaml:"db"`
}

type DB

type DB struct {
	Name     string `yaml:"Name"`
	Addr     string `yaml:"Addr"`
	Port     int    `yaml:"Port"`
	Password string `yaml:"password"`
	User     string `yaml:"User"`
	Protocol string `yaml:"protocol"`
}

type Param

type Param struct {
	Parameters []Parameter `yaml:"parameters"`
}

type Parameter

type Parameter struct {
	Name      string         `yaml:"name"`
	Cast      string         `yaml:"cast"`
	Volume    int            `yaml:"volume"`
	Speed     int            `yaml:"speed"`
	Tone      int            `yaml:"tone"`
	Tonescale int            `yaml:"tonescale"`
	Alpha     int            `yaml:"alpha"`
	Emotions  map[string]int `yaml:"emotions"`
}

Jump to

Keyboard shortcuts

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