aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan200101 <sentrycraft123@gmail.com>2023-03-14 10:52:31 +0100
committerJan200101 <sentrycraft123@gmail.com>2023-03-14 10:52:31 +0100
commit6af2c97fbe1d3642fb89f7d2dd0c63dcadb531ab (patch)
tree17c51a810113250be52916383f836a5b09cb9085
parent0a940eb06326643ee7271df036ca7de47cadd132 (diff)
downloadlab-bot-stash/command/commands.tar.gz
lab-bot-stash/command/commands.zip
stash 0a940eb06326643ee7271df036ca7de47cadd132: add example commandsstash/command/commands
-rw-r--r--labbot/addons/echo.py14
1 files changed, 14 insertions, 0 deletions
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