2018-07-10 15:46:17 +00:00
|
|
|
package commands
|
|
|
|
|
|
|
|
import (
|
|
|
|
"strings"
|
|
|
|
|
2019-06-05 05:56:12 +00:00
|
|
|
"github.com/akyoto/color"
|
2018-07-10 15:46:17 +00:00
|
|
|
"github.com/bwmarrin/discordgo"
|
|
|
|
)
|
|
|
|
|
|
|
|
// AnimeList shows the link for the anime list of a user.
|
|
|
|
func AnimeList(s *discordgo.Session, msg *discordgo.MessageCreate) bool {
|
2018-07-10 16:04:58 +00:00
|
|
|
if !strings.HasPrefix(msg.Content, "!animelist ") {
|
2018-07-10 15:46:17 +00:00
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
2019-06-05 05:56:12 +00:00
|
|
|
_, err := s.ChannelMessageSend(msg.ChannelID, "https://notify.moe/+"+strings.Split(msg.Content, " ")[1]+"/animelist/watching")
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
color.Red(err.Error())
|
|
|
|
}
|
|
|
|
|
2018-07-10 15:46:17 +00:00
|
|
|
return true
|
|
|
|
}
|