mirror of
https://github.com/aljazceru/chatgpt-telegram-bot.git
synced 2025-12-22 23:25:41 +01:00
only initialize enabled plugins
This commit is contained in:
@@ -16,15 +16,15 @@ class PluginManager:
|
|||||||
def __init__(self, config):
|
def __init__(self, config):
|
||||||
enabled_plugins = config.get('plugins', [])
|
enabled_plugins = config.get('plugins', [])
|
||||||
plugin_mapping = {
|
plugin_mapping = {
|
||||||
'wolfram': WolframAlphaPlugin(),
|
'wolfram': WolframAlphaPlugin,
|
||||||
'weather': WeatherPlugin(),
|
'weather': WeatherPlugin,
|
||||||
'crypto': CryptoPlugin(),
|
'crypto': CryptoPlugin,
|
||||||
'web_search': WebSearchPlugin(),
|
'web_search': WebSearchPlugin,
|
||||||
'spotify': SpotifyPlugin(),
|
'spotify': SpotifyPlugin,
|
||||||
'translate': TranslatePlugin(),
|
'translate': TranslatePlugin,
|
||||||
'image_search': ImageSearchPlugin(),
|
'image_search': ImageSearchPlugin,
|
||||||
}
|
}
|
||||||
self.plugins = [plugin_mapping[plugin] for plugin in enabled_plugins]
|
self.plugins = [plugin_mapping[plugin]() for plugin in enabled_plugins if plugin in plugin_mapping]
|
||||||
|
|
||||||
def get_functions_specs(self):
|
def get_functions_specs(self):
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user