expose config setting in info
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing

This commit is contained in:
stryan 2021-08-23 19:49:20 -04:00
parent 82f0d7af58
commit 47c9142763
2 changed files with 7 additions and 2 deletions

View File

@ -77,7 +77,11 @@ func main() {
var infomsg string var infomsg string
vlist := []string{} vlist := []string{}
for _, vt := range vtubers { for _, vt := range vtubers {
vlist = append(vlist, vt.Name) ann := ""
if vt.AnnounceLive {
ann = "*"
}
vlist = append(vlist, fmt.Sprintf("%v%v", vt.Name, ann))
} }
infomsg = fmt.Sprintf("Currently Simping For: \n%v", strings.Join(vlist, "\n")) infomsg = fmt.Sprintf("Currently Simping For: \n%v", strings.Join(vlist, "\n"))
client.SendText(evt.RoomID, infomsg) client.SendText(evt.RoomID, infomsg)

View File

@ -14,6 +14,7 @@ type VtuberConfig struct {
Name string `mapstructure:"name"` Name string `mapstructure:"name"`
ChannelID string `mapstructure:"channelid"` ChannelID string `mapstructure:"channelid"`
LiveMsg string `mapstructure:"msg"` LiveMsg string `mapstructure:"msg"`
Announce bool `mapstructure:"Announce"`
} }
type Vtuber struct { type Vtuber struct {
@ -45,7 +46,7 @@ func LoadVtubers() []*Vtuber {
} }
for _, vt := range vtubersRaw { for _, vt := range vtubersRaw {
log.Printf("adding vtuber %v", vt) log.Printf("adding vtuber %v", vt)
vtubers = append(vtubers, NewVtuber(vt.Name, vt.ChannelID, vt.LiveMsg)) vtubers = append(vtubers, NewVtuber(vt.Name, vt.ChannelID, vt.LiveMsg, vt.Announce))
} }
return vtubers return vtubers
} }