From 7b52156268ac18bb1493a99dddac4f1e4b53469b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorben=20G=C3=BCnther?= Date: Thu, 6 Oct 2022 13:30:17 +0200 Subject: [PATCH] commands list: Add built-in commands --- faceit.go | 4 ++++ static_commands.go | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/faceit.go b/faceit.go index 91db106..a4e706f 100644 --- a/faceit.go +++ b/faceit.go @@ -155,3 +155,7 @@ func (client *faceitClient) getPlayerInfo(url string) (*playerInfo, error) { return &player, nil } + +func faceitCommands() []string { + return []string{"elo"} +} diff --git a/static_commands.go b/static_commands.go index ff67f65..51bd2f3 100644 --- a/static_commands.go +++ b/static_commands.go @@ -15,7 +15,6 @@ var errTooShort = errors.New("input too short") func (b *bot) handleCommands(parsed []string, msg *twitch.PrivateMessage) error { if len(parsed) == 1 || parsed[1] == "list" { var commands []string - // TODO: Add preconfigured commands like elo query := ` SELECT name FROM static_commands @@ -40,6 +39,8 @@ func (b *bot) handleCommands(parsed []string, msg *twitch.PrivateMessage) error return err } + commands = append(commands, faceitCommands()...) + var text string for i, command := range commands { text += fmt.Sprintf("!%s", command) -- 2.44.0