Skip to content
This repository was archived by the owner on Jan 30, 2024. It is now read-only.
This repository was archived by the owner on Jan 30, 2024. It is now read-only.

Authentication module #2

@ghost

Description

I don't know how much you would like to to have built in but a standard authentication module might be a good idea.

The one I wrote is a bit premature. I had a section in the config file for each host which contained nicks and passwords.

[irc.freenode.net]
nick = foo
nick_password = bar

[irc.geekshed.net]
nick = oof
nick_pasword = rab

The module could look something like this

class NickToolsModule(Module):
    """A KitnIRC module which automatically configures nick.  """

    @Module.handle("WELCOME")
    def register_nick(self, client, hostmask):

        _log.info("Beginning automatic nick configuration...")

        host = client.server.host
        if self.controller.config.has_option(str(host), "nick"):
            nick = self.controller.config.get(str(host), "nick")
            client.nick(nick)
        if self.controller.config.has_option(str(host), "nick_password"):
            nick_password = self.controller.config.get(str(host), "nick_password")
            client.msg("NickServ", "IDENTIFY {}".format(nick_password))

        _log.info("Automatic nick configuration complete.")

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions