Closed senpos closed 6 years ago
What does this solve that send_message
does not?
@observer.on_event(ChatEventType.TWITCHCHATMESSAGE)
def message_handler(event):
observer.send_message('my text', event.channel)
We should keep events as just data. I think we also should strive to keep our API as simple and concise as possible.
What does this solve that send_message does not?
It is a shortcut, that's all. Almost always you want to send message to the channel from event.
But I agree, it will make code-base a bit more complicated, so probably shouldn't be done, at least for now.
So, the point here is - since it is very common thing to send message to the channel from where the event came in, it is quite boring to use
observer.send_message('my_text', event.channel)
all the time.It is convenient to have an opportunity to reply directly to the event's channel like:
I've seen this here.
It should be easy to implement, I think, but it requires passing
Observer
instance to theEvent
, so I am not sure about this now.