ayust / kitnirc

Python IRC bot framework.
MIT License
11 stars 7 forks source link

Added nickserv module #5

Closed ghost closed 9 years ago

ghost commented 10 years ago

In issue https://github.com/ayust/kitnirc/issues/2 there was discussion of creating a nickserv module. Here is one way of doing it. It is pretty simple but I think it is a pattern that will be repeated enough times to justify it's own module.

Problems

Does not check if the authentication was successful. A possible way of doing this is parsing the notice the nickserv returns. I was not sure if the nickserv message was a standard format.

ayust commented 10 years ago

A couple of nitpicks on logging - I tend to prefer a single log line with the action you're doing, rather than a "beginning" and "ending" pair, unless the process involves one or more back-and-forths with the server (which this doesn't, since it completely ignores any response).

Also, let's make the log message clearer - "configuration" is vague; "Identifying with NickServ" is specific.

Finally, we shouldn't print out "identify with nickserv" if we can't actually do that because of missing configuration - the action message and the missing config message should be mutually exclusive.

ayust commented 10 years ago

Sorry for the slow turnaround time. One more note: this shouldn't have a shebang in it; modules aren't meant to be run independently.

flexd commented 9 years ago

This seems like it could probably be merged. If the logging is alright now @ayust

ghost commented 9 years ago

:+1: