Skip to content

Commit

Permalink
If {command}_error method is not present then display default error i…
Browse files Browse the repository at this point in the history
…nfo anyways
  • Loading branch information
enebo committed Jan 1, 2014
1 parent e3428a3 commit 335bee9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/main/resources/purugin/command.rb
Expand Up @@ -142,7 +142,14 @@ def syntax_generated_command(name, syntax)
end
end

send "#{name}_error", sender, *args unless match
unless match
if respond_to? "#{name}_error"
send "#{name}_error", sender, *args
else
sender.msg "Invalid command: /#{name} #{args.join(' ')}"
sender.msg "Syntax: #{syntax}"
end
end
end
end

Expand Down

0 comments on commit 335bee9

Please sign in to comment.