From 6af2c97fbe1d3642fb89f7d2dd0c63dcadb531ab Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Tue, 14 Mar 2023 10:52:31 +0100 Subject: stash 0a940eb06326643ee7271df036ca7de47cadd132: add example commands --- labbot/addons/echo.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 labbot/addons/echo.py diff --git a/labbot/addons/echo.py b/labbot/addons/echo.py new file mode 100644 index 0000000..8011690 --- /dev/null +++ b/labbot/addons/echo.py @@ -0,0 +1,14 @@ +from labbot.commands import commands + +@commands.command() +async def echo(event, gl, message): + url = f"/projects/{event.project_id}/issues/{event.data['issue']['iid']}/notes" + await gl.post(url, data={"body": message}) + +@commands.command() +async def time(event, gl): + url = f"/projects/{event.project_id}/issues/{event.data['issue']['iid']}/notes" + await gl.post(url, data={"body": event.data["issue"]["updated_at"]}) + +def setup(bot) -> None: + pass -- cgit v1.2.3