From 2c10ea6f334141b19e7f74b3444ce250a8de5f06 Mon Sep 17 00:00:00 2001 From: Steve Date: Tue, 24 Jan 2023 21:25:42 -0500 Subject: [PATCH] don't ping with noone there --- main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 791e79b..d69e4d8 100644 --- a/main.go +++ b/main.go @@ -233,7 +233,9 @@ func main() { for k := range v.Subs { 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))) if err != nil { log.Println("error embeding video")