<commit_before># Description:
#   Get change results from hubot
#
# Dependencies:
#   None
#
# Commands:
#   hubot roll di - Returns number between 1 and 6
#   hubot roll dice - Returns 2 numbers between 1 and 6
#   hubot roll n dice - Returns n numbers between 1 and 6
#   hubot flip coin - Returns heads or tails
#
# Author:
#   nrentnilkram

diceValues = ['1', '2', '3', '4', '5', '6']
coinValues = ['heads', 'tails']

module.exports = (robot) ->
  robot.respond /roll di/i, (msg) ->
    count = if msg.match[1]? then parseInt(msg.match[1], 10) else 1
    msg.send msg.random diceValues

  robot.respond /roll( \d+)? dice/i, (msg) ->
    count = if msg.match[1]? then parseInt(msg.match[1], 10) else 2
    msg.send msg.random diceValues for i in [1..count]

  robot.respond /flip( a)? coin/i, (msg) ->
    msg.send msg.random coinValues<commit_msg>fix listeners<commit_after># Description:
#   Get change results from hubot
#
# Dependencies:
#   None
#
# Commands:
#   hubot roll di - Returns number between 1 and 6
#   hubot roll dice - Returns 2 numbers between 1 and 6
#   hubot roll n dice - Returns n numbers between 1 and 6
#   hubot flip coin - Returns heads or tails
#
# Author:
#   nrentnilkram

diceValues = ['1', '2', '3', '4', '5', '6']
coinValues = ['heads', 'tails']

module.exports = (robot) ->
  robot.respond /(roll di)?/i, (msg) ->
    msg.send msg.random diceValues

  robot.respond /roll( \d+)? dice/i, (msg) ->
    count = if msg.match[1]? then parseInt(msg.match[1], 10) else 2
    msg.send msg.random diceValues for i in [1..count]

  robot.respond /flip( a)? coin/i, (msg) ->
    msg.send msg.random coinValues
{'fraction_non_alphanumeric': 0.14538790470372634, 'fraction_numerical': 0.02626756261453879, 'mean_word_length': 3.1468354430379746, 'pattern_counts': {'":': 0, '<': 3, '<?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': '610048', 'n_tokens_mistral': 604, 'n_tokens_neox': 577, 'n_words': 200}