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,
|
"transformed_text", question,
|
||||||
)
|
)
|
||||||
|
|
||||||
var ogPostContent *string
|
var repliedToContent *string
|
||||||
if msg.ReplyToMessage != nil && msg.ReplyToMessage.SenderChat.ID == a.config.ChannelID {
|
if msg.ReplyToMessage != nil {
|
||||||
a.log.Info("message was a reply to channel post")
|
a.log.Info("message was a reply")
|
||||||
ogPostContent = &msg.ReplyToMessage.Text
|
repliedToContent = &msg.ReplyToMessage.Text
|
||||||
}
|
}
|
||||||
|
|
||||||
var username string
|
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{
|
response, err := a.proompter.Prompt(ctx, PromptRequest{
|
||||||
Question: question,
|
Question: question,
|
||||||
OriginalPostContent: ogPostContent,
|
OriginalPostContent: repliedToContent,
|
||||||
Username: username,
|
Username: username,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user