Exemplo n.º 1
0
	def __init__(self, config):
		BotBot.__init__(self, config.HOST, config.IDENTITY['nick'], config.IDENTITY['realname'])
		self.config = config
		self.d = Debug()

		# initialize PluginDispatcher and autoload modules
		self.plugin_dispatcher = PluginDispatcher(self, config.PATHS['plugins'])
		self.plugin_dispatcher.load_plugins(config.PLUGINS)
Exemplo n.º 2
0
	def quit(self, quit_reason=''):
		"""Invokes the before_quit hook of all loaded plugins before the QUIT message is sent to the server."""
		# invoke system hook
		self.plugin_dispatcher.invoke_all("before_quit")
		BotBot.quit(self, quit_reason)
Exemplo n.º 3
0
	def exit(self, exit_code=0):
		"""Invokes the before_unload hook of all loaded plugins before the module gets unloaded."""
		# invoke system hook
		self.plugin_dispatcher.invoke_all("before_unload")
		BotBot.exit(self, exit_code)
Exemplo n.º 4
0
	def handle_irc(self, msg):
		# handle "built in" event hooks
		BotBot.handle_irc(self, msg)

		# handle plugin event hooks
		self.plugin_dispatcher.handle_irc(msg)