]> git.somenet.org - pub/jan/mattermost-bot.git/blob - modules/WSvalentinesday.py
new file: modules/WSvalentinesday.py
[pub/jan/mattermost-bot.git] / modules / WSvalentinesday.py
1 # Mattermost Bot module.
2 #  Copyright (c) 2016-2024 by Someone <someone@somenet.org> (aka. Jan Vales <jan@jvales.net>)
3 #  published under MIT-License
4
5 import json
6 import re
7
8 # pylint: disable=wrong-import-position
9 from AbstractWSHandler import AbstractWSHandler
10 class WSValentinesday(AbstractWSHandler):
11     NAME = "valentinesday"
12
13     def on_WS_EVENT(self, data):
14         post = json.loads(data["data"]["post"])
15
16         if post["user_id"] == self.bot.api._my_user_id:
17             return False
18
19         self.bot.api.create_reaction(self.bot.api._my_user_id, post['id'], "rose")
20
21         return True