Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add prepend argument to minetest.chat_send_all #695

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions builtin/misc_helpers.lua
Expand Up @@ -91,4 +91,10 @@ function minetest.pos_to_string(pos)
return "(" .. pos.x .. "," .. pos.y .. "," .. pos.z .. ")"
end

minetest.chat_send_all = function(text, prepend)
local pls = minetest.get_connected_players()
for _, pl in pairs(pls) do
minetest.chat_send_player(pl:get_player_name(), text, prepend)
end
end

2 changes: 1 addition & 1 deletion doc/lua_api.txt
Expand Up @@ -1006,7 +1006,7 @@ minetest.check_player_privs(name, {priv1=true,...}) -> bool, missing_privs
minetest.get_player_ip(name) -> IP address string

Chat:
minetest.chat_send_all(text)
minetest.chat_send_all(text, prepend)
minetest.chat_send_player(name, text, prepend)
^ prepend: optional, if it is set to false "Server -!- " will not be prepended to the message

Expand Down