Remove autodeleting messages

This commit is contained in:
redfast00 2019-06-12 14:24:36 +02:00
parent 253c0f5f3f
commit 1ee37eb100
No known key found for this signature in database
GPG key ID: 5946E0E34FD0553C
2 changed files with 1 additions and 25 deletions

View file

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

View file

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