Skip to content

Commit

Permalink
improve check to determine if user is responding to bot
Browse files Browse the repository at this point in the history
  • Loading branch information
merefield committed Jun 4, 2024
1 parent bca5e23 commit 8114fa2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/discourse_chatbot/post/post_evaluation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def trigger_response(submission)
prior_user_was_bot = false

if post.post_number > 1
last_other_posting_user_id = ::Post.where(topic_id: topic.id).where.not(user_id: user.id).order(created_at: :desc)
last_other_posting_user_id = ::Post.where(topic_id: topic.id).order(created_at: :desc).limit(5).where.not(user_id: user.id).first.user_id
prior_user_was_bot = last_other_posting_user_id == bot_user.id

explicit_reply_to_bot = post.reply_to_user_id == bot_user.id
Expand Down

0 comments on commit 8114fa2

Please sign in to comment.