pyircbot/pyircbot/modules/ServerPassword.py

23 lines
642 B
Python
Raw Normal View History

2017-01-01 14:49:47 -08:00
#!/usr/bin/env python
"""
.. module:: ServerPassword
:synopsis: Allows connection to servers that require a password
.. moduleauthor:: Dave Pedu <dave@davepedu.com>
"""
2017-11-27 18:58:20 -08:00
from pyircbot.modulebase import ModuleBase, hook
2017-01-01 14:49:47 -08:00
class ServerPassword(ModuleBase):
def __init__(self, bot, moduleName):
ModuleBase.__init__(self, bot, moduleName)
2017-11-27 18:58:20 -08:00
@hook("_CONNECT")
def doConnect(self, msg, cmd):
2017-01-01 14:49:47 -08:00
"""Hook for when the IRC conneciton is opened"""
if "password" in self.config and self.config["password"]:
self.log.info("Sending server password")
self.bot.act_PASS(self.config["password"])