don't ping with noone there

This commit is contained in:
stryan 2023-01-24 21:25:42 -05:00
parent c875585c4b
commit 2c10ea6f33

View File

@ -233,7 +233,9 @@ func main() {
for k := range v.Subs { for k := range v.Subs {
subs += k.String() + " " subs += k.String() + " "
} }
client.SendText(room, fmt.Sprintf("Pinging %v", subs)) if len(v.Subs) > 0 {
client.SendText(room, fmt.Sprintf("Pinging %v", subs))
}
resp, err := client.SendStateEvent(room, event.NewEventType("im.vector.modular.widgets"), "dimension-m.video-simp-"+v.Name, NewYT(v.Name+"'s stream", v.CurrentStream, string(room))) resp, err := client.SendStateEvent(room, event.NewEventType("im.vector.modular.widgets"), "dimension-m.video-simp-"+v.Name, NewYT(v.Name+"'s stream", v.CurrentStream, string(room)))
if err != nil { if err != nil {
log.Println("error embeding video") log.Println("error embeding video")