<commit_before># Description:
#   あなたのお友達がお返事してくれるAPI
#
# Commands:
#   <text>さーん - お返事API

module.exports = (robot) ->
  robot.hear /^(.+)さーん/, (msg) ->
    if !msg?.match[1]?
      return
    robot.http("http://oganity.pw/json/co8.json")
      .get() (err, res, body) ->
        if !err
          destName = msg?.match[1]
          for destUser in JSON.parse(body)?.destUsers
            if destUser?.name is destName
              msg.reply "@#{msg.random destUser?.icons}＜#{msg.random destUser?.messages}"
              break
<commit_msg>msg.send instead to msg.reply<commit_after># Description:
#   あなたのお友達がお返事してくれるAPI
#
# Commands:
#   <text>さーん - お返事API

module.exports = (robot) ->
  robot.hear /^(.+)さーん/, (msg) ->
    if !msg?.match[1]?
      return
    robot.http("http://oganity.pw/json/co8.json")
      .get() (err, res, body) ->
        if !err
          destName = msg?.match[1]
          for destUser in JSON.parse(body)?.destUsers
            if destUser?.name is destName
              msg.send "@#{msg.random destUser?.icons}＜#{msg.random destUser?.messages}"
              break

{'fraction_non_alphanumeric': 0.1637852593266606, 'fraction_numerical': 0.00545950864422202, 'mean_word_length': 2.216374269005848, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '7086077', 'n_tokens_mistral': 414, 'n_tokens_neox': 417, 'n_words': 75}