From d0163282eca06827dbb45b4f721fc5e31a242438 Mon Sep 17 00:00:00 2001 From: Someone Date: Wed, 28 Feb 2024 00:11:58 +0100 Subject: [PATCH] new file: modules/WSvalentinesday.py --- modules/WSvalentinesday.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 modules/WSvalentinesday.py diff --git a/modules/WSvalentinesday.py b/modules/WSvalentinesday.py new file mode 100644 index 0000000..c823bc3 --- /dev/null +++ b/modules/WSvalentinesday.py @@ -0,0 +1,21 @@ +# Mattermost Bot module. +# Copyright (c) 2016-2024 by Someone (aka. Jan Vales ) +# published under MIT-License + +import json +import re + +# pylint: disable=wrong-import-position +from AbstractWSHandler import AbstractWSHandler +class WSValentinesday(AbstractWSHandler): + NAME = "valentinesday" + + def on_WS_EVENT(self, data): + post = json.loads(data["data"]["post"]) + + if post["user_id"] == self.bot.api._my_user_id: + return False + + self.bot.api.create_reaction(self.bot.api._my_user_id, post['id'], "rose") + + return True -- 2.43.0