<commit_before>require 'cinch'
require_relative '../utils/utils.rb'


class RollPlugin
  include Cinch::Plugin

  match /^(!|@)roll(\d*)? ?(\d*)?/

  def execute(m, msgtype, numberofdices, rollnumber)
    rng = Random.new
    if numberofdices.to_i >= 150 && msgtype == '@'
      msgtype_reply(m, msgtype, "The roll is too big. Please consider using less than 150 rolls multiple times to achieve your result.")
    end
    rollnumber.length == 0 ? rollnumber = 10000 : rollnumber = rollnumber.to_i
    numberofdices.length == 0 ? numberofdices = 1 : numberofdices = numberofdices.to_i
    if numberofdices == 1
      rollednumber = rng.rand(1..rollnumber)
      BotUtils.msgtype_reply(m, msgtype, "Rolled between 1 and #{rollnumber}: #{rollednumber}")
    else
      numberarray = Array.new
      numbersstring = String.new
      numberofdices.times do
        numberarray << rng.rand(1..rollnumber)
      end
      numberarray.each do |rollednumber|
        numbersstring << "#{rollednumber} "
      end
      BotUtils.msgtype_reply(m, msgtype, "Rolled #{numberofdices} dice between 1 and #{rollnumber}: #{numbersstring}")
    end
  end

end<commit_msg>LAST FUCKING FIX OF ROLLPLUGIN OK<commit_after>require 'cinch'
require_relative '../utils/utils.rb'


class RollPlugin
  include Cinch::Plugin

  match /^(!|@)roll(\d*)? ?(\d*)?/

  def execute(m, msgtype, numberofdices, rollnumber)
    rng = Random.new
    if numberofdices.to_i >= 150 && msgtype == '@'
      BotUtils.msgtype_reply(m, msgtype, "The roll is too big. Please consider using less than 150 rolls multiple times to achieve your result.")
    end
    rollnumber.length == 0 ? rollnumber = 10000 : rollnumber = rollnumber.to_i
    numberofdices.length == 0 ? numberofdices = 1 : numberofdices = numberofdices.to_i
    if numberofdices == 1
      rollednumber = rng.rand(1..rollnumber)
      BotUtils.msgtype_reply(m, msgtype, "Rolled between 1 and #{rollnumber}: #{rollednumber}")
    else
      numberarray = Array.new
      numbersstring = String.new
      numberofdices.times do
        numberarray << rng.rand(1..rollnumber)
      end
      numberarray.each do |rollednumber|
        numbersstring << "#{rollednumber} "
      end
      BotUtils.msgtype_reply(m, msgtype, "Rolled #{numberofdices} dice between 1 and #{rollnumber}: #{numbersstring}")
    end
  end

end
{'fraction_non_alphanumeric': 0.11605995717344754, 'fraction_numerical': 0.016274089935760173, 'mean_word_length': 3.3020257826887662, 'pattern_counts': {'":': 0, '<': 11, '<?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': '2189000', 'n_tokens_mistral': 779, 'n_tokens_neox': 738, 'n_words': 198}