numberoverzero / bottom

asyncio-based rfc2812-compliant IRC Client
http://bottom-docs.readthedocs.io
MIT License
74 stars 23 forks source link

Allow Sending RAW Commands via bot.send() #53

Closed biergaizi closed 6 years ago

biergaizi commented 6 years ago

Currently, bot.send() interprets a list of pre-coded IRC commands and extends them to raw. It is not possible to send raw command directly to a IRC server, rendering the library less useful to work with different non-standard commands without modifying or monkey-patching bottom.

For example, a vast majority of IRCv3 commands is an extension to RFC-2812.

Could you please add a way to send raw commands?

numberoverzero commented 6 years ago

Thanks for opening an issue. Raw commands were requested in #32, and added in v2.1.0: docs. send_raw will append a newline if one isn't provided; this means you can't use it to build up a message in multiple calls.

client.send_raw("PRIVMSG #blood-dev :hello, world!")

This is definitely a place that the docs could be improved, since they don't provide any examples. Are there one or two simple IRCv3 commands you'd recommend for the docs? It's probably the main reason to use send_raw so I'd like to tailor the examples.

numberoverzero commented 6 years ago

There's also this section, which is not intuitively labeled (why is core functionality under a heading "Extensions"?): Send and trigger raw messages

That example focuses on capabilities registration and adding a handler for capabilities messages to the client.

biergaizi commented 6 years ago

Sorry for sending a duplicate report which has been implemented and documented already, this issue can be closed as duplicate of #32.

How did I miss the documentation: during the initial development, I used the full documentation from readthedocs.io, which was good. Last week I wanted to add SASL login functionality, which requires CAP from IRCv3 (already documented as the example) but not supported by bot.send(). I came back to the GitHub project page, and started reading README.md again...

Where is the link to readthedocs.io? It's gone! (actually it's in the GitHub project description...) Okay, let's read README.md first... > The full API consists of 1 class, with 6 methods It looks like there was no way to send raw commands...

You could update README.md to

Thanks for writing this great IRC framework.

numberoverzero commented 6 years ago

Those are some great points, thank you. I'll update the README to correct the API section and to include an explicit link to the documentation. Sorry about missing the The full API consists of 1 class, with 6 methods - that's definitely incorrect and I can see where it caused confusion.

impredicative commented 6 years ago

It would really help to see transparent SASL authentication as a feature. Without this it's hard for me to use this great package.

numberoverzero commented 6 years ago

@impredicative I created a new issue for SASL; thanks for the feedback.