Skip to content
This repository was archived by the owner on Sep 21, 2023. It is now read-only.
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions tor/core/inbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@

log = logging.getLogger(__name__)

THINK_EMOTES = [
":thinking_party:",
":think-rotate:",
":monoclethink:",
":eggplant-think:",
":thinking-screensaver:"
]
Comment thread
erenbektas marked this conversation as resolved.
Outdated


def extract_sub_from_url(url: str) -> str:
"""returns the sub name from the given url without "r/" at the start."""
Expand Down Expand Up @@ -73,10 +81,21 @@ def process_reply(reply: Comment, cfg: Config) -> None:
if "image transcription" in r_body or is_comment_transcription(reply, cfg):
post_link = reply.submission.url
sub_name = extract_sub_from_url(post_link)
user_url = i18n["urls"]["reddit_url"].format(f"/u/{username}")
post_url = i18n["urls"]["reddit_url"].format(context)
tor_post = submission.tor_url
Comment thread
itsthejoker marked this conversation as resolved.
Outdated
emote = random.choice(THINK_EMOTES)
message = i18n["responses"]["general"]["transcript_on_tor_post"].format(
sub_name=sub_name,
post_link=post_link,
)
send_to_modchat(
f"<{user_url}|u/{username}> posted a "
f"<{post_url}|transcription> on "
f"<{tor_post}|ToR post> instead of posting it on "
f"<{post_link}|r/{sub_name}>. {emote}"
Comment thread
erenbektas marked this conversation as resolved.
Outdated
cfg,
)
elif matches := [
match.group()
for match in [regex.search(reply.body) for regex in MOD_SUPPORT_PHRASES]
Expand Down