MarseyWorld/files/helpers/discord.py

17 lines
443 B
Python
Raw Normal View History

2022-05-04 23:09:46 +00:00
import requests
2022-10-16 08:14:15 +00:00
2022-05-04 23:09:46 +00:00
from .const import *
def discord_message_send(channel_id, message):
requests.post(
f"https://discordapp.com/api/channels/{channel_id}/messages",
headers={"Authorization": f"Bot {DISCORD_BOT_TOKEN}"},
data={"content": message},
timeout=5)
2022-07-10 14:25:42 +00:00
2022-08-30 02:03:48 +00:00
def send_changelog_message(message):
2022-10-30 00:43:55 +00:00
discord_message_send(DISCORD_CHANGELOG_CHANNEL_ID, message)
2022-07-10 14:25:42 +00:00
def send_wpd_message(message):
discord_message_send(WPD_CHANNEL_ID, message)