diff --git a/files/helpers/discord.py b/files/helpers/discord.py index 6b4011b7cf..88080d5bc2 100644 --- a/files/helpers/discord.py +++ b/files/helpers/discord.py @@ -66,7 +66,7 @@ def set_nick(user, nick): requests.patch(url, headers=headers, json=data) def send_message(message): - url=f"https://discordapp.com/api/channels/850266802449678366/messages" + url=f"https://discordapp.com/api/channels/851846904283267094/messages" headers = {"Authorization": f"Bot {BOT_TOKEN}"} data={"content": message} requests.post(url, headers=headers, data=data) \ No newline at end of file diff --git a/files/routes/posts.py b/files/routes/posts.py index 89facddf65..db59c6df01 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -914,14 +914,15 @@ def submit_post(v): n = Notification(comment_id=c.id, user_id=v.id) g.db.add(n) g.db.flush() - send_message(f"https://{site}{new_post.permalink}") v.post_count = v.submissions.filter_by(is_banned=False, deleted_utc=0).count() g.db.add(v) cache.delete_memoized(User.userpagelisting, v) cache.delete_memoized(frontlist) - if "[changelog]" in new_post.title: cache.delete_memoized(changeloglist) + if "[changelog]" in new_post.title: + send_message(f"https://{site}{new_post.permalink}") + cache.delete_memoized(changeloglist) if request.headers.get("Authorization"): return new_post.json else: return redirect(new_post.permalink)