Updated discord bot

This commit is contained in:
Eduard Urbach 2017-11-08 14:36:51 +01:00
parent 8242dd2537
commit 512ea75c53

View File

@ -102,7 +102,7 @@ func onMessage(s *discordgo.Session, m *discordgo.MessageCreate) {
if strings.HasPrefix(m.Content, "!s ") { if strings.HasPrefix(m.Content, "!s ") {
term := m.Content[len("!s "):] term := m.Content[len("!s "):]
users, animes, posts, threads := arn.Search(term, 3, 3, 3, 3) users, animes, posts, threads, tracks := arn.Search(term, 3, 3, 3, 3, 3)
message := "" message := ""
for _, user := range users { for _, user := range users {
@ -121,6 +121,10 @@ func onMessage(s *discordgo.Session, m *discordgo.MessageCreate) {
message += "https://notify.moe" + thread.Link() + "\n" message += "https://notify.moe" + thread.Link() + "\n"
} }
for _, track := range tracks {
message += "https://notify.moe" + track.Link() + "\n"
}
if len(users) == 0 && len(animes) == 0 && len(posts) == 0 && len(threads) == 0 { if len(users) == 0 && len(animes) == 0 && len(posts) == 0 && len(threads) == 0 {
message = "Sorry, I couldn't find anything using that term." message = "Sorry, I couldn't find anything using that term."
} }