From 3efcfd31cc2b5d7b880b1b9ad0a43ffdcffdfa60 Mon Sep 17 00:00:00 2001 From: lyx0 Date: Fri, 15 Oct 2021 18:35:16 +0200 Subject: [PATCH] add pingme command --- pkg/commands/pingme.go | 14 ++++++++++++++ pkg/handlers/command.go | 3 +++ 2 files changed, 17 insertions(+) create mode 100644 pkg/commands/pingme.go diff --git a/pkg/commands/pingme.go b/pkg/commands/pingme.go new file mode 100644 index 0000000..26cc98c --- /dev/null +++ b/pkg/commands/pingme.go @@ -0,0 +1,14 @@ +package commands + +import ( + "fmt" + + "github.com/gempir/go-twitch-irc/v2" +) + +func Pingme(channel string, user string, client *twitch.Client) { + response := fmt.Sprintf("@%s", user) + + client.Say(channel, response) + +} diff --git a/pkg/handlers/command.go b/pkg/handlers/command.go index 4badeaa..1edb09e 100644 --- a/pkg/handlers/command.go +++ b/pkg/handlers/command.go @@ -118,5 +118,8 @@ func HandleCommand(message twitch.PrivateMessage, twitchClient *twitch.Client, u twitchClient.Say(message.Channel, "Pleb's can't pyramid FeelsBadMan") } + case "pingme": + commands.Pingme(message.Channel, message.User.DisplayName, twitchClient) + } }