From 1ee37eb100a7778699a2017b852df04ed4e98452 Mon Sep 17 00:00:00 2001 From: redfast00 Date: Wed, 12 Jun 2019 14:24:36 +0200 Subject: [PATCH] Remove autodeleting messages --- app/app.py | 20 +------------------- config.py.example | 6 ------ 2 files changed, 1 insertion(+), 25 deletions(-) diff --git a/app/app.py b/app/app.py index 0d4f3a1..7153670 100644 --- a/app/app.py +++ b/app/app.py @@ -7,7 +7,7 @@ from datetime import datetime import requests import config import random -from mattermostdriver import Driver + app = Flask(__name__) @@ -21,13 +21,6 @@ response_setting = "in_channel" from app import models -driver = Driver({ - 'port': 443, - 'url': config.server_url, - 'token': config.personal_auth_token -}) - -driver.login() def check_regular(username): '''Check if a user has the permissions of a regular user.''' @@ -130,17 +123,6 @@ def slotmachien_request(username, command): 'username': username, 'token': config.slotmachien_token, 'text': command}) return r.text -def is_bestuur(username): - return username in config.bestuur - -@app.route('/new_message', methods=['POST']) -def new_message(): - if not is_bestuur(request.values.get("user_name")): - delete_message(request.values.get("post_id")) - return "" - -def delete_message(message_id): - driver.posts.delete_post(message_id) @app.route('/door', methods=['POST']) @requires_token('door') diff --git a/config.py.example b/config.py.example index 8723a8b..cd41db5 100644 --- a/config.py.example +++ b/config.py.example @@ -8,9 +8,3 @@ tokens = { } slotmachien_url = 'https://kelder.zeus.ugent.be/slotmachien/slack/' slotmachien_token = '123' -personal_auth_token='zeusbot-auth-token' -server_url='mattermost.myserver.com' -bestuur = [ - "user1", - "user2" -]