You've already forked grok
handle all replies
This commit is contained in:
10
main.go
10
main.go
@@ -146,10 +146,10 @@ func (a *App) handleMessage(ctx context.Context, msg *tgbotapi.Message) error {
|
||||
"transformed_text", question,
|
||||
)
|
||||
|
||||
var ogPostContent *string
|
||||
if msg.ReplyToMessage != nil && msg.ReplyToMessage.SenderChat.ID == a.config.ChannelID {
|
||||
a.log.Info("message was a reply to channel post")
|
||||
ogPostContent = &msg.ReplyToMessage.Text
|
||||
var repliedToContent *string
|
||||
if msg.ReplyToMessage != nil {
|
||||
a.log.Info("message was a reply")
|
||||
repliedToContent = &msg.ReplyToMessage.Text
|
||||
}
|
||||
|
||||
var username string
|
||||
@@ -159,7 +159,7 @@ func (a *App) handleMessage(ctx context.Context, msg *tgbotapi.Message) error {
|
||||
|
||||
response, err := a.proompter.Prompt(ctx, PromptRequest{
|
||||
Question: question,
|
||||
OriginalPostContent: ogPostContent,
|
||||
OriginalPostContent: repliedToContent,
|
||||
Username: username,
|
||||
})
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user