forked from rDrama/rDrama
master
parent
21e644285f
commit
6d5c0a5110
|
@ -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)
|
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue