modchannels.lua 497 B

12345678910111213141516
  1. --
  2. -- Mod channels experimental handlers
  3. --
  4. local mod_channel = core.mod_channel_join("experimental_preview")
  5. core.register_on_modchannel_message(function(channel, sender, message)
  6. print("[minimal][modchannels] Server received message `" .. message
  7. .. "` on channel `" .. channel .. "` from sender `" .. sender .. "`")
  8. if mod_channel:is_writeable() then
  9. mod_channel:send_all("experimental answers to preview")
  10. mod_channel:leave()
  11. end
  12. end)
  13. print("[minimal][modchannels] Code loaded!")