discord: fix tag search commands being limited to 2 tags.

This commit is contained in:
evazion
2021-03-14 16:20:55 -05:00
parent 808c039f03
commit 28c0a48117
10 changed files with 29 additions and 21 deletions

View File

@@ -19,7 +19,7 @@ class DiscordSlashCommand
def call
tags = params[:tags]
query = PostQueryBuilder.new(tags, User.anonymous).normalized_query
query = PostQueryBuilder.new(tags, User.anonymous, tag_limit: nil).normalized_query
count = query.fast_count(estimate_count: true, skip_cache: true)
respond_with("`#{tags}`: #{count} posts")

View File

@@ -28,7 +28,7 @@ class DiscordSlashCommand
def call
tags = params[:tags]
limit = params.fetch(:limit, 3).clamp(1, 10)
posts = Post.user_tag_match(tags, User.anonymous).limit(limit)
posts = Post.user_tag_match(tags, User.anonymous, tag_limit: nil).limit(limit)
respond_with(posts: posts)
end

View File

@@ -26,7 +26,7 @@ class DiscordSlashCommand
def call
tags = params[:tags]
limit = params.fetch(:limit, 1).clamp(1, 10)
posts = Post.user_tag_match(tags, User.anonymous).random(limit)
posts = Post.user_tag_match(tags, User.anonymous, tag_limit: nil).random(limit)
respond_with(posts: posts)
end