<commit_before>module Ruboty
  module Handlers
    class Lgtm < Base
      DEFAULT_KEYWORD = 'yuyushiki'

      on /lgtm( me)? ?(?<keyword>.+)?/, name: 'lgtm', description: 'Generate lgtm image matching with the keyword'

      env :LGTM_ENDPOINT, "LGTM server endpoint (default: http://lgtm.herokuapp.com)", optional: true

      def lgtm(message = {})
        keyword = message[:keyword] || DEFAULT_KEYWORD
        url = generate(keyword)

        if url
          message.reply(url)
        end
      end

      private

      def generate(query)
        Ruboty::Lgtm::Client.new(query: query, endpoint: ENV["LGTM_ENDPOINT"]).generate
      end
    end
  end
end<commit_msg>Add message to response no image found to close #2<commit_after>module Ruboty
  module Handlers
    class Lgtm < Base
      DEFAULT_KEYWORD = 'yuyushiki'

      on /lgtm( me)? ?(?<keyword>.+)?/, name: 'lgtm', description: 'Generate lgtm image matching with the keyword'

      env :LGTM_ENDPOINT, "LGTM server endpoint (default: http://lgtm.herokuapp.com)", optional: true

      def lgtm(message = {})
        keyword = message[:keyword] || DEFAULT_KEYWORD
        url = generate(keyword)

        if url
          message.reply(url)
        else
          message.reply('Could not find any lgtm images. Try another keyword.')
        end
      end

      private

      def generate(query)
        Ruboty::Lgtm::Client.new(query: query, endpoint: ENV["LGTM_ENDPOINT"]).generate
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.1091644204851752, 'fraction_numerical': 0.0006738544474393531, 'mean_word_length': 2.5783132530120483, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2983510', 'n_tokens_mistral': 474, 'n_tokens_neox': 461, 'n_words': 128}