From 8e9e6ceea196a50e60a9290a8726f63af989b56d Mon Sep 17 00:00:00 2001 From: Christoph Stahl Date: Thu, 13 Oct 2022 11:35:11 +0200 Subject: [PATCH] Fist few lines of code --- maubot.yaml | 9 +++++++++ syngbot.py | 11 +++++++++++ 2 files changed, 20 insertions(+) create mode 100644 maubot.yaml create mode 100644 syngbot.py diff --git a/maubot.yaml b/maubot.yaml new file mode 100644 index 0000000..751c0af --- /dev/null +++ b/maubot.yaml @@ -0,0 +1,9 @@ +maubot: 0.1.0 +id: de.k-fortytwo.syng +version: 0.2.1 +license: AGPL-3.0-or-later +modules: + - syngbot +main_class: SyngBot +dependencies: + - requests diff --git a/syngbot.py b/syngbot.py new file mode 100644 index 0000000..10701d7 --- /dev/null +++ b/syngbot.py @@ -0,0 +1,11 @@ +from maubot import Plugin, MessageEvent +from maubot.handlers import command + + +class SyngBot(Plugin): + @command.new("search", help="Search for a song") + async def syng(self, evt: MessageEvent): + # forward parameters to the `/query` endpoint of https://karaoke.oh14.de + + results = await self.http.get("https://karaoke.oh14.de/query", params=evt.args) + await evt.respond("Syng is a bot")