Why is my message id a table?

Sorry for bothering anyone with a likely simple question …

Whenever i send a message from one script to another the message is received, however, it never satisfies any conditions. By printing the message_id i found out that it was a table for some reason?

posting the message:

msg.post("/rooms#rooms_levels", "next_room")

receiving the message

function on_message(self, message, message_id)
	print(message_id)
	if message_id == hash("next_room") then
		print("hi")
		go.delete(self.current_room)
		self.current_room = collectionfactory.create("#0-1")
	end
end

with the output of the print being: “table: 0x0289b9e625b0”

I think you swapped message and message_id. The function on_message should be:

function on_message(self, message_id, message)

and message is a table with the data, if any, you want to post.

6 Likes

Thanks for solving my stupid issue @roccosaienz. You the goat