- if @rulesets.has_key? params[:ruleset]
- @games[m.channel] = ShiritoriGame.new(
- m.channel, @rulesets[params[:ruleset]],
- @bot.timer,
- lambda {|msg| m.reply msg},
- lambda {remove_game m.channel} )
- m.reply "Shiritori has started. Please say the first word"
+ ruleset = params[:ruleset].downcase
+ if @rulesets.has_key? ruleset
+ begin
+ @games[m.channel] = ShiritoriGame.new(
+ m.channel, load_ruleset(ruleset),
+ @bot.timer,
+ lambda {|msg| m.reply msg},
+ lambda {remove_game m.channel} )
+ m.reply "Shiritori has started. Please say the first word"
+ rescue => e
+ m.reply "couldn't start #{ruleset} shiritori: #{e}"
+ end