exirc icon indicating copy to clipboard operation
exirc copied to clipboard

Custom Command Handling

Open rockerBOO opened this issue 10 years ago • 4 comments

I'm working with a IRC that has custom CAP (capabilities), which adds more commands. Is there a good way to handle these messages so they can be handled outside of the ExIrc.Client?

Requesting capabilites:

< CAP REQ :twitch.tv/membership

Example message from the IRC server

%IrcMessage{args: ["#rockerboo", "rockerboo"], cmd: "CLEARCHAT", ctcp: false, host: [], nick: [], server: "tmi.twitch.tv", user: []}

https://github.com/justintv/Twitch-API/blob/master/chat/capabilities.md#membership

rockerBOO avatar Jun 19 '15 02:06 rockerBOO

I think we just need to expand this function to send a new event (maybe :custom or :unrecognized) or something, that way your handler can accept all unrecognized messages and do whatever you wish with them. Thoughts?

bitwalker avatar Jun 19 '15 05:06 bitwalker

That'd probably be great! Maybe just pass a :cmd event?

rockerBOO avatar Jun 19 '15 14:06 rockerBOO

I wouldn't mind that, something to keep in mind though is that something received by that callback may not actually be a command (it could just be garbage), so we probably want a way to signify that while it's an event that can be handled, you can't necessarily rely on it being a valid message.

bitwalker avatar Jun 19 '15 14:06 bitwalker

Would it be better to have some list of "CMD" options to handle?

['MODE', 'USERSTATE', 'CAP']

rockerBOO avatar Jun 19 '15 15:06 rockerBOO