hedwig-im / hedwig

An Adapter-based Bot Framework for Elixir Applications
MIT License
650 stars 73 forks source link

[Feature Request] Add a catch all field to the Message Struct #44

Closed supernullset closed 8 years ago

supernullset commented 8 years ago

The Flowdock API provides a way for messages to be posted to a particular thread, which is one of the defining features of the product. As far as I can tell, there is no way in the Message struct to keep a reference to a message's thread so that replies can be appended to a thread as opposed to the main room. Is it possible to add a catch all field to the message which can just be a Map? This would provide a bucket to hold extra data which may not need to be used by all adapters.

EDIT: This is relevant to me because I am working on a Flowdock Adapter for Hedwig

scrogson commented 8 years ago

Hey there @supernullset,

The %Message{} struct has a key for just such things: https://github.com/hedwig-im/hedwig/blob/master/lib/hedwig/message.ex#L27

Give that a try and let me know if it doesn't work for you.

supernullset commented 8 years ago

@scrogson Thanks for pointing me in the right direction! This should work just fine.