Skip to content

Commit

Permalink
Fix search regex match on meme command
Browse files Browse the repository at this point in the history
  • Loading branch information
devth committed Mar 28, 2023
1 parent d7f152d commit a193fd1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/yetibot/commands/meme.clj
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
(cmd-hook
["meme" #"^meme$"]
#"^popular$" chat-instance-popular
#"^(?:search\s)?(.+)" search-cmd
#"^search\s+(.+)$" search-cmd
#"^(.+?)\s*:(.+)\/(.*)$" generate-cmd
#"^(.+?)\s*:(.+)$" generate-auto-split-cmd
#"^preview\s+(.+)" preview-cmd
Expand Down
4 changes: 4 additions & 0 deletions src/yetibot/models/imgflip.clj
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@
)

(defn generate-meme-by-query [query text0 & [text1]]
(info "generate-meme-by-query" {:query query :text0 text0})
(if-let [meme (first (search-memes query))]
(apply generate-meme
(into [(:id meme)]
Expand All @@ -156,3 +157,6 @@
{:success false
:error_message (str "Couldn't find any memes for " query)}))

(comment
(generate-meme-by-query "lipstick" "text0")
)

0 comments on commit a193fd1

Please sign in to comment.