mirror of
https://github.com/minetest-mods/irc_commands.git
synced 2024-11-18 07:30:25 +01:00
Add !say command
This commit is contained in:
parent
230d9aad72
commit
607f3a02ad
18
init.lua
18
init.lua
@ -64,3 +64,21 @@ mt_irc.register_bot_command("cmd", {
|
|||||||
mt_irc.say(from, "Command run successfuly")
|
mt_irc.say(from, "Command run successfuly")
|
||||||
end
|
end
|
||||||
end})
|
end})
|
||||||
|
|
||||||
|
mt_irc.register_bot_command("say", {
|
||||||
|
params = "message",
|
||||||
|
description = "Say something",
|
||||||
|
func = function (from, args)
|
||||||
|
if args == "" then
|
||||||
|
mt_irc.say(from, "You need a message")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
if not irc_users[from] then
|
||||||
|
mt_irc.say(from, "You are not loged in")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
if minetest.check_player_privs(irc_users[from], {shout=true}) then
|
||||||
|
minetest.chat_send_all("<"..irc_users[from].."@IRC> "..args)
|
||||||
|
mt_irc.say(from, "Message sent successfuly")
|
||||||
|
end
|
||||||
|
end})
|
||||||
|
Loading…
Reference in New Issue
Block a user