purge discord from site code

pull/90/head
Aevann 2023-01-20 07:31:53 +02:00
parent 61202cb5aa
commit f17fade8a6
9 changed files with 1 additions and 44 deletions

1
env
View File

@ -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"

View File

@ -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"}

View File

@ -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)

View File

@ -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

View File

@ -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 = """<p>Hi <a href="/id/{id}"><img loading="lazy" src="/pp
<p>Don't worry, we're here to help! We won't let you post or comment anything that doesn't express your love and acceptance towards the trans community. Feel free to resubmit your {type} with <code>{AGENDAPOSTER_PHRASE}</code> included.</p>
<p><em>This is an automated message; if you need help, you can message us <a href="/contact">here</a>.</em></p>"""
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"]

View File

@ -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)

View File

@ -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 *

View File

@ -0,0 +1 @@
alter table users drop column discord_id;

View File

@ -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
--