discord: add /random command.

This commit is contained in:
evazion
2021-03-11 21:23:20 -06:00
parent b79bd8407f
commit 698be2d0e4
8 changed files with 146 additions and 88 deletions

View File

@@ -103,9 +103,7 @@ module PostSets
end
def get_random_posts
per_page.times.inject([]) do |all, _|
all << ::Post.user_tag_match(tag_string).random
end.compact.uniq
::Post.user_tag_match(tag_string).random(per_page)
end
def posts