Import from github and add cbb support

This commit is contained in:
2024-11-10 19:28:43 -05:00
parent b29f567574
commit 74f4a89235
2 changed files with 107 additions and 2 deletions

View File

@ -2,7 +2,8 @@ package bot
import (
"discord-cfb-bot/config"
"discord-cfb-bot/internal/clients"
cfbClient "git.ewnix.net/phlux/discord-cfb-bot/internal/clients/cfb"
cbbClient "git.ewnix.net/discord-cfb-bot/internal/clients/cbb"
"github.com/bwmarrin/discordgo"
"fmt"
"strings"
@ -35,7 +36,13 @@ func commandHandler(s *discordgo.Session, m *discordgo.MessageCreate) {
if strings.HasPrefix(m.Content, "!cfb ") {
teamName := strings.TrimSpace(strings.TrimPrefix(m.Content, "!cfb "))
response := cfb.GetGameInfo(teamName)
response := cfbClient.GetGameInfo(teamName)
s.ChannelMessageSend(m.ChannelID, response)
}
if strings.HasPrefix(m.Content, "!cbb ") {
teamName := strings.TrimSpace(strings.TrimPrefix(m.Content, "!cbb "))
response := cbbClient.GetGameInfo(teamName)
s.ChannelMessageSend(m.ChannelID, response)
}
}