From 8c6dd4ee8bb66ee08710ed1a8540f738bc6b05e4 Mon Sep 17 00:00:00 2001 From: Micke Nordin Date: Wed, 21 Apr 2021 16:00:01 +0200 Subject: [PATCH] Initial commit of a very smol mattermost bot --- abed.py | 10 ++++++++++ bottn.py | 17 +++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 abed.py create mode 100644 bottn.py diff --git a/abed.py b/abed.py new file mode 100644 index 0000000..c29f431 --- /dev/null +++ b/abed.py @@ -0,0 +1,10 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +import re +from mmpy_bot import Plugin, listen_to +from mmpy_bot import Message +class Abed(Plugin): + @listen_to(".*[Cc]ool.*") + async def wake_up(self, message: Message): + self.driver.reply_to(message, "cool, cool, cool.") diff --git a/bottn.py b/bottn.py new file mode 100644 index 0000000..300a460 --- /dev/null +++ b/bottn.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python3.9 +# -*- coding: utf-8 -*- + +from mmpy_bot import Bot, Settings +from abed import Abed + +bot = Bot( + settings=Settings( + MATTERMOST_URL = "http://127.0.0.1", + MATTERMOST_PORT = 8065, + BOT_TOKEN = "##TOKEN##", + BOT_TEAM = "##TEAM##", + SSL_VERIFY = False, + ), # Either specify your settings here or as environment variables. + plugins=[Abed()], # Add your own plugins here. +) +bot.run()