Merge pull request 'Добавлена проверка привилегии shout перед отправкой сообщения в телеграмм' (#1) from bad/telegram:master into master
Reviewed-on: #1
This commit is contained in:
commit
80e2e487ae
2
init.lua
2
init.lua
@ -177,7 +177,9 @@ end)
|
|||||||
-- Don't send messages from MT to telegram if we don't know where to
|
-- Don't send messages from MT to telegram if we don't know where to
|
||||||
if chat_id then
|
if chat_id then
|
||||||
minetest.register_on_chat_message(function(name, message)
|
minetest.register_on_chat_message(function(name, message)
|
||||||
|
if minetest.check_player_privs(name, {shout=true}) then
|
||||||
telegram.send_message(chat_id, "<" .. name .. "> " .. message)
|
telegram.send_message(chat_id, "<" .. name .. "> " .. message)
|
||||||
|
end
|
||||||
return false
|
return false
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user