Skip to content

Commit

Permalink
improve chat err messages for end users
Browse files Browse the repository at this point in the history
closes #36
  • Loading branch information
jbpratt committed Aug 16, 2020
1 parent 515925a commit d5643ed
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,11 @@ func (b *bot) provideAltAngelthumpLink(m dggchat.Message, s *dggchat.Session) {
srv, ok := servers[strings.ToLower(server)]
if !ok {
log.Printf("[##] invalid server: %s is not a valid Angelthump server", server)
b.sendMessageDedupe("not a valid Angelthump server", s)
failed := "not a valid Angelthump server. Please pick from ["
for k := range servers {
failed += fmt.Sprintf(" %s ", k)
}
b.sendMessageDedupe(failed, s)
return
}

Expand All @@ -554,6 +558,12 @@ func (b *bot) provideAltAngelthumpLink(m dggchat.Message, s *dggchat.Session) {
return
}

if atd.Username == "" {
log.Printf("[##] unable to find %s's AT username: %+v", username, atd)
b.sendMessageDedupe("could not locate the streamer's AngelThump username", s)
return
}

output := fmt.Sprintf("https://strims.gg/m3u8/https://%s.angelthump.com/hls/%s/index.m3u8", srv, atd.Username)
b.sendMessageDedupe(output, s)
}
Expand Down

0 comments on commit d5643ed

Please sign in to comment.