beerchat.on_channel_message = function(channel, playername, message)
This commit is contained in:
parent
c98faed08c
commit
02ad635df6
2
hash.lua
2
hash.lua
@ -6,6 +6,8 @@ local channel_message_string = "|#${channel_name}| <${from_player}> ${message}"
|
||||
hashchat_lastrecv = {}
|
||||
|
||||
local hash_send_all = function(msg, name, channel_name)
|
||||
beerchat.on_channel_message(channel_name, name, msg)
|
||||
|
||||
for _,player in ipairs(minetest.get_connected_players()) do
|
||||
local target = player:get_player_name()
|
||||
-- Checking if the target is in this channel
|
||||
|
4
hooks.lua
Normal file
4
hooks.lua
Normal file
@ -0,0 +1,4 @@
|
||||
|
||||
-- called on every channel message
|
||||
beerchat.on_channel_message = function(channel, playername, message)
|
||||
end
|
1
init.lua
1
init.lua
@ -29,6 +29,7 @@ beerchat = {
|
||||
|
||||
local MP = minetest.get_modpath("beerchat")
|
||||
dofile(MP.."/format_message.lua")
|
||||
dofile(MP.."/hooks.lua")
|
||||
dofile(MP.."/storage.lua")
|
||||
dofile(MP.."/session.lua")
|
||||
dofile(MP.."/pm.lua")
|
||||
|
@ -43,6 +43,8 @@ minetest.register_on_chat_message(function(name, message)
|
||||
elseif beerchat.playersChannels[name] and not beerchat.playersChannels[name][channel_name] then
|
||||
minetest.chat_send_player(name, "You need to join this channel in order to be able to send messages to it")
|
||||
else
|
||||
beerchat.on_channel_message(channel_name, name, message)
|
||||
|
||||
for _,player in ipairs(minetest.get_connected_players()) do
|
||||
local target = player:get_player_name()
|
||||
-- Checking if the target is in this channel
|
||||
|
Loading…
x
Reference in New Issue
Block a user