handle all replies

This commit is contained in:
2026-02-04 23:01:50 +03:00
parent a4f156eac7
commit bc49bedde6

10
main.go
View File

@@ -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 {