Skip to content
This repository has been archived by the owner on Sep 21, 2023. It is now read-only.

WIP Slack Ping For Transcripts on Tor Posts #357

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 7 commits
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
14 changes: 14 additions & 0 deletions tor/core/inbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,25 @@ 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
submission = reply.submission
username = reply.author.name
sub_name = extract_sub_from_url(post_link)
user_url = i18n["urls"]["reddit_url"].format(f"/u/{username}")
post_url = submission.url
tor_post = submission.tor_url
itsthejoker marked this conversation as resolved.
Show resolved Hide resolved
message = i18n["responses"]["general"]["transcript_on_tor_post"].format(
sub_name=sub_name,
post_link=post_link,
)
send_to_modchat(
i18n["mod"]["transcript_on_tor_post"].format(
user_url=user_url,
post_url=post_url,
tor_post=tor_post,
sub_name=sub_name,
post_link=post_link
)
)
elif matches := [
match.group()
for match in [regex.search(reply.body) for regex in MOD_SUPPORT_PHRASES]
Expand Down
2 changes: 2 additions & 0 deletions tor/strings/en_US.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ mod:
formatting_issues: |
I detected formatting issues in the transcription by {author}: {issues}
{link}
transcript_on_tor_post: |
Looks like {user_url} posted a [transcription]({post_url}) on [ToR Post]({tor_post}) instead of posting it on [r/{sub_name}]({post_link}). :facepalm:
Copy link
Member

@itsthejoker itsthejoker Aug 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This string is going to slack, right? It would probably be better if we use the native slack link formatting.

Suggested change
Looks like {user_url} posted a [transcription]({post_url}) on [ToR Post]({tor_post}) instead of posting it on [r/{sub_name}]({post_link}). :facepalm:
Looks like <{user_url}|{user_url}> posted a <{post_url}|transcription> on <{tor_post}|the ToR Post> instead of posting it on <{post_link}|r/{sub_name}>. :facepalm:

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

Copy link
Member Author

@erenbektas erenbektas Aug 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright I finally found some more time to work on this. I didn't know that slack had some different formatting for that! Thankss

posts:
discovered_submit_title: |
{sub} | {type} | "{title}"
Expand Down