diff options
Diffstat (limited to 'plugin_loader/utilities.py')
| -rw-r--r-- | plugin_loader/utilities.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/plugin_loader/utilities.py b/plugin_loader/utilities.py new file mode 100644 index 00000000..4e9a1ac0 --- /dev/null +++ b/plugin_loader/utilities.py @@ -0,0 +1,18 @@ +from aiohttp import ClientSession + +async def http_request(method="", url="", **kwargs): + async with ClientSession() as web: + res = await web.request(method, url, **kwargs) + return { + "status": res.status, + "headers": dict(res.headers), + "body": await res.text() + } + +async def ping(**kwargs): + return "pong" + +util_methods = { + "ping": ping, + "http_request": http_request +}
\ No newline at end of file |
