Use minetest.register_chatcommand instead of minetest.register_on_chat_message