TheComamba / UnKenny

A FoundryVTT module providing NPCs with artificial intelligence.
MIT License
2 stars 5 forks source link

Can we avoid storing data in the chat message content? #107

Closed TheComamba closed 18 hours ago

TheComamba commented 4 months ago

We are currently placing some chat data directly inside the content, and replacing it at a later point. This is hacky, and has some side effects. For example, any module working with the chatMessage hook (Talking Actors, for example) sees and processes our flag and json before we can replace it.

The ui.chat.processMessage function returns the message object, but I think only after it has been posted. Can we modify that object afterwards?

I am also not sure if some async functions are called in a fire-and-forget manner, meaning we could be dealing with concurrency issues if we chose this path.