diff --git a/env b/env index 26aecada5..6929f0783 100644 --- a/env +++ b/env @@ -8,7 +8,6 @@ export PROXY_URL="http://localhost:18080" export LOG_DIRECTORY="/var/log/rdrama" export SETTINGS_FILENAME="/site_settings.json" export GIPHY_KEY="blahblahblah" -export DISCORD_BOT_TOKEN="blahblahblah" export TURNSTILE_SITEKEY="blahblahblah" export TURNSTILE_SECRET="blahblahblah" export YOUTUBE_KEY="blahblahblah" diff --git a/files/assets/css/main.css b/files/assets/css/main.css index 809f47388..00ea845ad 100644 --- a/files/assets/css/main.css +++ b/files/assets/css/main.css @@ -139,7 +139,6 @@ .fa-volume-mute:before{content:"\f6a9"} .fa-times:before{content:"\f00d"} .fa-mobile:before{content:"\f3ce"} -.fa-discord:before{content:"\f392"} .fa-github:before{content:"\f09b"} .fa-twitter:before{content:"\f099"} .fa-git-alt:before{content:"\f841"} diff --git a/files/classes/user.py b/files/classes/user.py index d803b5c8c..78b2582d0 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -143,7 +143,6 @@ class User(Base): defaultsorting = Column(String, default="hot") defaulttime = Column(String, default=DEFAULT_TIME_FILTER) custom_filter_list = Column(String) - discord_id = Column(String) original_username = Column(String) referred_by = Column(Integer, ForeignKey("users.id")) currently_held_lottery_tickets = Column(Integer, default=0) diff --git a/files/helpers/actions.py b/files/helpers/actions.py index 8ded713b8..67d6d246d 100644 --- a/files/helpers/actions.py +++ b/files/helpers/actions.py @@ -14,7 +14,6 @@ from files.classes.polls import CommentOption, SubmissionOption from files.helpers.alerts import send_repeatable_notification from files.helpers.config.const import * from files.helpers.const_stateful import * -from files.helpers.discord import discord_message_send from files.helpers.get import * from files.helpers.logging import log_file from files.helpers.sanitize import * @@ -475,8 +474,6 @@ def execute_under_siege(v:User, target:Optional[Union[Submission, Comment]], bod g.db.add(v) t = time.strftime("%Y-%m-%d %H:%M:%S", time.gmtime(time.time())) log_file(f"[{t}] {v.id} @{v.username} {type} {v.age}s", "under_siege.log") - discord_message_send(UNDER_SIEGE_CHANNEL_ID, - f"<{SITE_FULL}/id/{v.id}> `@{v.username} {type} {v.age}s`") return False return True diff --git a/files/helpers/config/const.py b/files/helpers/config/const.py index f7f7455f5..317c7c62a 100644 --- a/files/helpers/config/const.py +++ b/files/helpers/config/const.py @@ -37,7 +37,6 @@ PROXY_URL = environ.get("PROXY_URL").strip() LOG_DIRECTORY = environ.get("LOG_DIRECTORY") SETTINGS_FILENAME = environ.get("SETTINGS_FILENAME") GIPHY_KEY = environ.get("GIPHY_KEY").strip() -DISCORD_BOT_TOKEN = environ.get("DISCORD_BOT_TOKEN").strip() TURNSTILE_SITEKEY = environ.get("TURNSTILE_SITEKEY").strip() TURNSTILE_SECRET = environ.get("TURNSTILE_SECRET").strip() YOUTUBE_KEY = environ.get("YOUTUBE_KEY").strip() @@ -370,9 +369,6 @@ AGENDAPOSTER_MSG_HTML = """

Hi here.

""" -DISCORD_CHANGELOG_CHANNEL_ID = 1034632681788538980 -WPD_CHANNEL_ID = 1013990963846332456 -UNDER_SIEGE_CHANNEL_ID = 1041917843094110239 PIN_AWARD_TEXT = " (pin award)" THEMES = ["4chan","classic","classic_dark","coffee","dark","dramblr","light","midnight","tron","win98"] diff --git a/files/helpers/discord.py b/files/helpers/discord.py deleted file mode 100644 index cf944322d..000000000 --- a/files/helpers/discord.py +++ /dev/null @@ -1,16 +0,0 @@ -import requests - -from .config.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) - -def send_changelog_message(message): - discord_message_send(DISCORD_CHANGELOG_CHANNEL_ID, message) - -def send_wpd_message(message): - discord_message_send(WPD_CHANNEL_ID, message) diff --git a/files/routes/posts.py b/files/routes/posts.py index 37922a67b..be59adbd1 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -16,7 +16,6 @@ from files.classes import * from files.helpers.actions import * from files.helpers.alerts import * from files.helpers.config.const import * -from files.helpers.discord import * from files.helpers.get import * from files.helpers.regex import * from files.helpers.sanitize import * diff --git a/migrations/20230120-remove-discord.sql b/migrations/20230120-remove-discord.sql new file mode 100644 index 000000000..fa8880dfa --- /dev/null +++ b/migrations/20230120-remove-discord.sql @@ -0,0 +1 @@ +alter table users drop column discord_id; diff --git a/schema.sql b/schema.sql index af4886ff5..87182855a 100644 --- a/schema.sql +++ b/schema.sql @@ -953,7 +953,6 @@ CREATE TABLE public.users ( is_private boolean DEFAULT false NOT NULL, unban_utc integer DEFAULT 0 NOT NULL, custom_filter_list character varying(1000) DEFAULT ''::character varying, - discord_id character varying(64), stored_subscriber_count integer DEFAULT 0 NOT NULL, original_username character varying(30), customtitle character varying(1000), @@ -1394,14 +1393,6 @@ ALTER TABLE ONLY public.users ADD CONSTRAINT one_banner UNIQUE (bannerurl); --- --- Name: users one_discord_account; Type: CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.users - ADD CONSTRAINT one_discord_account UNIQUE (discord_id); - - -- -- Name: pgbench_accounts pgbench_accounts_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- @@ -1706,13 +1697,6 @@ CREATE INDEX commentvotes_comments_type_index ON public.commentvotes USING btree CREATE INDEX cvote_user_index ON public.commentvotes USING btree (user_id); --- --- Name: discord_id_idx; Type: INDEX; Schema: public; Owner: - --- - -CREATE INDEX discord_id_idx ON public.users USING btree (discord_id); - - -- -- Name: domains_domain_trgm_idx; Type: INDEX; Schema: public; Owner: - -- @@ -2793,4 +2777,3 @@ ALTER TABLE ONLY public.comments -- -- PostgreSQL database dump complete -- -