Fist few lines of code

This commit is contained in:
Christoph Stahl 2022-10-13 11:35:11 +02:00
commit 8e9e6ceea1
2 changed files with 20 additions and 0 deletions

9
maubot.yaml Normal file
View file

@ -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

11
syngbot.py Normal file
View file

@ -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")