return
end
name = p[:name].to_s
- name = @bot.config['wheelfortune.game_name'] if name.empty?
+ if name.empty?
+ name = m.source.get_botdata("wheelfortune.game_name") || @bot.config['wheelfortune.game_name']
+ else
+ m.source.set_botdata("wheelfortune.game_name", name.dup)
+ end
@games[ch] = game = WoFGame.new(name, m.botuser, p[:single], p[:max])
@bot.say chan, _("%{who} just created a new %{name} game to %{max} points (%{single} per question, %{price} per vowel)") % {
:name => game.name,
return
end
game = @games[ch]
+
+ if m.botuser != game.manager and !m.botuser.permit?('wheelfortune::manage::other::add')
+ m.reply _("you can't add questions to the %{name} game on %{chan}") % {
+ :name => game.name,
+ :chan => p[:chan]
+ }
+ end
+
cat = p[:cat].to_s
clue = p[:clue].to_s
ans = p[:ans].to_s
}
return
end
- do_cancel(ch)
+ # is the botuser the manager or allowed to cancel someone else's game?
+ if m.botuser == game.manager or m.botuser.permit?('wheelfortune::manage::other::cancel')
+ do_cancel(ch)
+ else
+ m.reply _("you can't cancel the current game")
+ end
end
def do_cancel(ch)