Reply when you have insufficient privileges for a command

This commit is contained in:
ShadowNinja 2014-02-05 19:40:25 -05:00
parent 55ea96e88e
commit e2ff55d70f
1 changed files with 6 additions and 4 deletions

View File

@ -86,11 +86,13 @@ mt_irc:register_bot_command("cmd", {
mt_irc:reply("Not a valid command") mt_irc:reply("Not a valid command")
return return
end end
if minetest.check_player_privs(irc_users[user.nick], command.privs) then if not minetest.check_player_privs(irc_users[user.nick], command.privs) then
minetest.log("action", user.nick.."@IRC runs " mt_irc:reply("Your privileges are insufficient")
..args.." as "..irc_users[user.nick]) return
command.func(irc_users[user.nick], (params or ""))
end end
minetest.log("action", user.nick.."@IRC runs "
..args.." as "..irc_users[user.nick])
command.func(irc_users[user.nick], (params or ""))
end}) end})
mt_irc:register_bot_command("say", { mt_irc:register_bot_command("say", {