Skip to content

Commit

Permalink
feat(twitch-bot): update invite command (#518)
Browse files Browse the repository at this point in the history
  • Loading branch information
barbequeorbarbecue authored Nov 29, 2024
1 parent 7baee74 commit 42af683
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions apps/twitch-bot/internal/command/invite.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ import (
"errors"
"log"
"os"
"strings"

"github.com/gempir/go-twitch-irc/v3"
"github.com/senchabot-opensource/monorepo/config"
"github.com/senchabot-opensource/monorepo/helper"
"github.com/senchabot-opensource/monorepo/model"
)
Expand All @@ -20,18 +18,9 @@ func (c *commands) InviteCommand(context context.Context, message twitch.Private
return nil, errors.New("command did not executed in senchabot")
}

if len(params) < 1 {
cmdResp.Message = config.InviteCommandInfo
return &cmdResp, nil
}

var channelName = message.User.Name
if strings.ToLower(params[0]) != channelName {
cmdResp.Message = "You need to specify your channel name. !invite " + channelName
return &cmdResp, nil
}

var twitchChannelId = message.User.ID

alreadyJoined, err := c.service.CreateTwitchChannel(context, twitchChannelId, channelName, nil)
if err != nil {
return nil, errors.New("(CreateTwitchChannel) Error: " + err.Error())
Expand All @@ -51,6 +40,6 @@ func (c *commands) InviteCommand(context context.Context, message twitch.Private
}
}

cmdResp.Message = "I joined your Twitch channel, sweetie"
cmdResp.Message = "Hi VoHiYo I joined your Twitch channel, sweetie. Learn how to use my features here: docs.senchabot.app"
return &cmdResp, nil
}

0 comments on commit 42af683

Please sign in to comment.