local sc = smart_chat local S = sc.S local cname = "join" local short = "j" local activate = minetest.settings:get_bool("smart_chat.cmd_" .. cname, true) if(not activate) then return end sc.register_help({ Name = cname, Usage = "/c " .. cname .. " ", Description = S("Join or change a channel to ."), Parameter = "", Shortcut = "/c " .. short .. " ", } ) sc.registered_commands[cname] = function(player, parameter) if(parameter[2] == nil or parameter[2] == "") then sc.print(player, sc.red .. S("Error: No channel to join given.")) return end sc.report(player, S("Leaves the Channel.")) sc.player[player] = parameter[2] sc.report(player, S("Enter the Channel.")) end -- sc["join" sc.registered_commands[short] = function(player, parameter) sc.registered_commands[cname](player, parameter) end -- sc["j"