mirror of
https://github.com/aljazceru/chatgpt-telegram-bot.git
synced 2025-12-22 15:14:54 +01:00
feat: website screenshot plugin
This commit is contained in:
25
bot/plugins/webshot.py
Normal file
25
bot/plugins/webshot.py
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
from typing import Dict
|
||||||
|
from .plugin import Plugin
|
||||||
|
|
||||||
|
class WebshotPlugin(Plugin):
|
||||||
|
"""
|
||||||
|
A plugin to screenshot a website
|
||||||
|
"""
|
||||||
|
def get_source_name(self) -> str:
|
||||||
|
return "WebShot"
|
||||||
|
|
||||||
|
def get_spec(self) -> [Dict]:
|
||||||
|
return [{
|
||||||
|
"name": "screenshot_website",
|
||||||
|
"description": "Show screenshot/image of a website from a given url or domain name",
|
||||||
|
"parameters": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"url": {"type": "string", "description": "Website url or domain name"}
|
||||||
|
},
|
||||||
|
"required": ["url"],
|
||||||
|
},
|
||||||
|
}]
|
||||||
|
|
||||||
|
async def execute(self, function_name, **kwargs) -> Dict:
|
||||||
|
return {'result': f'https://image.thum.io/get/maxAge/12/width/720/{kwargs["url"]}'}
|
||||||
Reference in New Issue
Block a user