remotes/1693045480750635534/spooky-22
Aevann1 2021-12-31 16:09:44 +02:00
parent 21e644285f
commit 6d5c0a5110
2 changed files with 5 additions and 5 deletions

View File

@ -57,8 +57,8 @@ def set_nick(user, nick):
data={"nick": nick}
requests.patch(url, headers=headers, json=data, timeout=5)
def send_message(message):
url=f"https://discordapp.com/api/channels/924485611715452940/messages"
def send_discord_message(message):
headers = {"Authorization": f"Bot {BOT_TOKEN}"}
data={"content": message}
requests.post(url, headers=headers, data=data, timeout=5)
requests.post(f"https://discordapp.com/api/channels/924485611715452940/messages", headers=headers, data=data, timeout=5)
requests.post(f"https://discordapp.com/api/channels/924486091795484732/messages", headers=headers, data=data, timeout=5)

View File

@ -7,7 +7,7 @@ from files.helpers.sanitize import *
from files.helpers.filters import *
from files.helpers.markdown import *
from files.helpers.alerts import *
from files.helpers.discord import send_message
from files.helpers.discord import send_discord_message
from files.helpers.const import *
from files.classes import *
from flask import *
@ -1176,7 +1176,7 @@ def submit_post(v):
cache.delete_memoized(frontlist)
cache.delete_memoized(User.userpagelisting)
if v.admin_level > 1 and ("[changelog]" in new_post.title or "(changelog)" in new_post.title) and not new_post.private:
send_message(f"https://{site}{new_post.permalink}")
send_discord_message(f"https://{site}{new_post.permalink}")
cache.delete_memoized(changeloglist)
g.db.commit()