From 419ed61dd38c6a8e468448ff76e08df8556ef12d Mon Sep 17 00:00:00 2001 From: justcool393 Date: Fri, 14 Oct 2022 11:46:39 -0700 Subject: [PATCH] discord ids as constants --- files/helpers/const.py | 2 ++ files/helpers/discord.py | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/files/helpers/const.py b/files/helpers/const.py index 0a9295eb4..cc66473d2 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -156,6 +156,8 @@ AGENDAPOSTER_MSG_HTML = """

Hi here.

""" +DISCORD_CHANGELOG_CHANNEL_IDS = [924485611715452940, 1013992002624426015] +WPD_CHANNEL_ID = 1013990963846332456 ################################################################################ ### SITE SPECIFIC CONSTANTS diff --git a/files/helpers/discord.py b/files/helpers/discord.py index dd72bb077..7fe8ce844 100644 --- a/files/helpers/discord.py +++ b/files/helpers/discord.py @@ -46,9 +46,9 @@ def set_nick(user, nick): def send_changelog_message(message): data={"content": message} - requests.post("https://discordapp.com/api/channels/924485611715452940/messages", headers=headers, data=data, timeout=5) - requests.post("https://discordapp.com/api/channels/1013992002624426015/messages", headers=headers, data=data, timeout=5) + for id in DISCORD_CHANGELOG_CHANNEL_IDS: + requests.post(f"https://discordapp.com/api/channels/{id}/messages", headers=headers, data=data, timeout=5) def send_wpd_message(message): data={"content": message} - requests.post("https://discordapp.com/api/channels/1013990963846332456/messages", headers=headers, data=data, timeout=5) + requests.post(f"https://discordapp.com/api/channels/{WPD_CHANNEL_ID}/messages", headers=headers, data=data, timeout=5)