PyIRCBot
— Main class of the bot¶
Main bot class
-
class
pyircbot.pyircbot.
ModuleLoader
[source]¶ Bases:
object
-
deportmodule
(name)[source]¶ Remove a module’s code from memory. If the module is loaded it will be unloaded silently.
Parameters: moduleName (str) – Name of the module to import
-
getBestModuleForService
(service)[source]¶ Get the first module that provides the specified service
Parameters: service (str) – name of the service searched for Returns: object – the module object, if found. None if not found.
-
getmodulebyname
(name)[source]¶ Get a module object by name
Parameters: name (str) – name of the module to return Returns: object – the module object
-
getmodulesbyservice
(service)[source]¶ Get a list of modules that provide the specified service
Parameters: service (str) – name of the service searched for Returns: list – a list of module objects
-
importmodule
(name)[source]¶ Import a module
Parameters: moduleName (str) – Name of the module to import
-
loadmodule
(name)[source]¶ Activate a module.
Parameters: moduleName (str) – Name of the module to activate
-
modules
= None¶ instances of modules
-
redomodule
(name)[source]¶ Reload a running module from disk
Parameters: moduleName (str) – Name of the target module
-
-
class
pyircbot.pyircbot.
PrimitiveBot
(botconfig)[source]¶ Bases:
pyircbot.pyircbot.ModuleLoader
-
closeAllModules
()[source]¶ Deport all modules (for shutdown). Modules are unloaded in the opposite order listed in the config.
-
-
class
pyircbot.pyircbot.
PyIRCBot
(botconfig)[source]¶ Bases:
pyircbot.pyircbot.PrimitiveBot
Parameters: botconfig (dict) – The configuration of this instance of the bot. Passed by main.py. -
getConfigPath
(moduleName)[source]¶ Return the absolute path for a module’s config file
Parameters: moduleName (str) – the module who’s config file we want
-
getDataPath
(moduleName)[source]¶ Return the absolute path for a module’s data dir
Parameters: moduleName (str) – the module who’s data dir we want
-
kill
(message='Help! Another thread is killing me :(', forever=True)[source]¶ Close the connection violently
Parameters:
-
log
= None¶ Reference to logger object
-
loop
= None¶ Reference to BotRPC thread
-
ratelimit
= None¶ IRC protocol handler
-
version
= '5.0.0'¶
-