mirror of
https://github.com/aljazceru/chatgpt-telegram-bot.git
synced 2025-12-19 05:35:20 +01:00
Add auto_tts plugin
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import json
|
||||
|
||||
from plugins.gtts_text_to_speech import GTTSTextToSpeech
|
||||
from plugins.auto_tts import AutoTextToSpeech
|
||||
from plugins.dice import DicePlugin
|
||||
from plugins.youtube_audio_extractor import YouTubeAudioExtractorPlugin
|
||||
from plugins.ddg_image_search import DDGImageSearchPlugin
|
||||
@@ -36,6 +37,7 @@ class PluginManager:
|
||||
'dice': DicePlugin,
|
||||
'deepl_translate': DeeplTranslatePlugin,
|
||||
'gtts_text_to_speech': GTTSTextToSpeech,
|
||||
'auto_tts': AutoTextToSpeech,
|
||||
'whois': WhoisPlugin,
|
||||
'webshot': WebshotPlugin,
|
||||
}
|
||||
@@ -47,14 +49,14 @@ class PluginManager:
|
||||
"""
|
||||
return [spec for specs in map(lambda plugin: plugin.get_spec(), self.plugins) for spec in specs]
|
||||
|
||||
async def call_function(self, function_name, arguments):
|
||||
async def call_function(self, function_name, helper, arguments):
|
||||
"""
|
||||
Call a function based on the name and parameters provided
|
||||
"""
|
||||
plugin = self.__get_plugin_by_function_name(function_name)
|
||||
if not plugin:
|
||||
return json.dumps({'error': f'Function {function_name} not found'})
|
||||
return json.dumps(await plugin.execute(function_name, **json.loads(arguments)), default=str)
|
||||
return json.dumps(await plugin.execute(function_name, helper, **json.loads(arguments)), default=str)
|
||||
|
||||
def get_plugin_source_name(self, function_name) -> str:
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user