aatxe / irc

the irc crate – usable, async IRC for Rust
Mozilla Public License 2.0
526 stars 100 forks source link

Possible to get channel mode? #200

Closed nuxeh closed 4 years ago

nuxeh commented 4 years ago

Hi, is there any way to get channel modes using the irc crate?

The following returns Result<()> so guessing it doesn't allow for this... https://docs.rs/irc/0.13.6/irc/client/ext/trait.ClientExt.html#method.send_mode

If not, any thoughts on how feasible this would be to implement?

Thanks!

aatxe commented 4 years ago

The method you linked is a way of sending a command to the server to change modes. If you would like to know what modes are associated with a channel, you have to query the server and get back a response of this form.

nuxeh commented 4 years ago

Ok, thanks... but how would such a response be elicited from the server using this crate?

The send_mode function can't be used without providing an array of ModeType, and doesn't like an empty array slice.

Is this something that needs implementing to achieve, or have I missed something obvious?

nuxeh commented 4 years ago

I say this since, as far as i'm aware, to query a channel's modes you would normally send /mode #channel, i.e. the mode command with no mode parameters.