revert back from \n to \n\n for easier to read source and making linefeeds work when theres <pre> or ```

pull/134/head
Aevann 2023-02-26 12:20:32 +02:00
parent af1b52b98a
commit 3a07858639
8 changed files with 20 additions and 21 deletions

View File

@ -102,13 +102,13 @@ def execute_snappy(post:Submission, v:User):
if post.url and not post.url.startswith('/') and not post.url.startswith(SITE_FULL) and not post.url.startswith(BAN_EVASION_FULL):
if post.url.startswith('https://old.reddit.com/r/'):
rev = post.url.replace('https://old.reddit.com/', '')
rev = f"* [unddit.com](https://unddit.com/{rev})\n"
rev = f"* [unddit.com](https://unddit.com/{rev})\n\n"
elif post.url.startswith("https://old.reddit.com/u/"):
rev = post.url.replace('https://old.reddit.com/u/', '')
rev = "* [camas.unddit.com](https://camas.unddit.com/reddit-search/#\u007b\"author\":\"{rev}\",\"resultSize\":100\u007d)\n"
rev = "* [camas.unddit.com](https://camas.unddit.com/reddit-search/#\u007b\"author\":\"{rev}\",\"resultSize\":100\u007d)\n\n"
else: rev = ''
body += f"Snapshots:\n\n{rev}* [archive.org](https://web.archive.org/{post.url})\n* [ghostarchive.org](https://ghostarchive.org/search?term={quote(post.url)})\n* [archive.ph](https://archive.ph/?url={quote(post.url)}&run=1) (click to archive)\n\n"
body += f"Snapshots:\n\n{rev}* [archive.org](https://web.archive.org/{post.url})\n\n* [ghostarchive.org](https://ghostarchive.org/search?term={quote(post.url)})\n\n* [archive.ph](https://archive.ph/?url={quote(post.url)}&run=1) (click to archive)\n\n"
archive_url(post.url)
captured = []
@ -134,14 +134,13 @@ def execute_snappy(post:Submission, v:User):
addition = f'**[{title}]({href})**:\n\n'
if href.startswith('https://old.reddit.com/r/'):
rev = href.replace('https://old.reddit.com/', '')
addition += f'* [unddit.com](https://unddit.com/{rev})\n'
addition += f'* [unddit.com](https://unddit.com/{rev})\n\n'
if href.startswith('https://old.reddit.com/u/'):
rev = href.replace('https://old.reddit.com/u/', '')
addition += "* [camas.unddit.com](https://camas.unddit.com/reddit-search/#\u007b\"author\":\"{rev}\",\"resultSize\":100\u007d)\n"
addition += f'* [archive.org](https://web.archive.org/{href})\n'
addition += f'* [ghostarchive.org](https://ghostarchive.org/search?term={quote(href)})\n'
addition += f'* [archive.ph](https://archive.ph/?url={quote(href)}&run=1) (click to archive)\n'
addition += '\n'
addition += "* [camas.unddit.com](https://camas.unddit.com/reddit-search/#\u007b\"author\":\"{rev}\",\"resultSize\":100\u007d)\n\n"
addition += f'* [archive.org](https://web.archive.org/{href})\n\n'
addition += f'* [ghostarchive.org](https://ghostarchive.org/search?term={quote(href)})\n\n'
addition += f'* [archive.ph](https://archive.ph/?url={quote(href)}&run=1) (click to archive)\n\n'
if len(f'{body}{addition}') > COMMENT_BODY_LENGTH_LIMIT: break
body += addition
archive_url(href)

View File

@ -806,7 +806,7 @@ elif SITE == 'watchpeopledie.tv':
DESCRIPTION = "People die and this is the place to see it. You only have one life, don't make the mistakes seen here."
PIN_LIMIT = 4
WELCOME_MSG = """Hi, you! Welcome to WatchPeopleDie.tv, this really cool site where you can go to watch people die. I'm @CLiTPEELER! If you have any questions about how things work here, or suggestions on how to make them work better than they already do, definitely slide on into my DMs (no fat chicks).\nThere's an enormously robust suite of fun features we have here and we're always looking for more to add. Way, way too many to go over in an automated welcome message. And you're probably here for the videos of people dying more than any sort of weird, paradoxical digital community aspect anyway, so I won't bore you with a tedious overview of them. Just head on over to [your settings page](https://watchpeopledie.tv/settings/profile) and have a look at some of the basic profile stuff, at least. You can change your profile picture, username, flair, colors, banners, bio, profile anthem (autoplaying song on your page, like it's MySpace or some shit, hell yeah), CSS, all sorts of things.\nOr you can just go back to the main feed and carry on with watching people die. That's what the site is for, after all. Have fun!\nAnyway, in closing, WPD is entirely open source. We don't really need new full-time coders or anything, but if you'd like to take a look at our repo - or even submit a PR to change, fix, or add some things - go right ahead! Our codebase lives at https://fsdfsd.net/rDrama/rDrama\nWell, that's all. Thanks again for signing up. It's an automated message and all, but I really do mean that. Thank you, specifically. I love you. Romantically. Deeply. Passionately.\nHave fun!"""
WELCOME_MSG = """Hi, you! Welcome to WatchPeopleDie.tv, this really cool site where you can go to watch people die. I'm @CLiTPEELER! If you have any questions about how things work here, or suggestions on how to make them work better than they already do, definitely slide on into my DMs (no fat chicks).\n\nThere's an enormously robust suite of fun features we have here and we're always looking for more to add. Way, way too many to go over in an automated welcome message. And you're probably here for the videos of people dying more than any sort of weird, paradoxical digital community aspect anyway, so I won't bore you with a tedious overview of them. Just head on over to [your settings page](https://watchpeopledie.tv/settings/profile) and have a look at some of the basic profile stuff, at least. You can change your profile picture, username, flair, colors, banners, bio, profile anthem (autoplaying song on your page, like it's MySpace or some shit, hell yeah), CSS, all sorts of things.\n\nOr you can just go back to the main feed and carry on with watching people die. That's what the site is for, after all. Have fun!\n\nAnyway, in closing, WPD is entirely open source. We don't really need new full-time coders or anything, but if you'd like to take a look at our repo - or even submit a PR to change, fix, or add some things - go right ahead! Our codebase lives at https://fsdfsd.net/rDrama/rDrama\n\nWell, that's all. Thanks again for signing up. It's an automated message and all, but I really do mean that. Thank you, specifically. I love you. Romantically. Deeply. Passionately.\n\nHave fun!"""
FEATURES['PATRON_ICONS'] = True
FEATURES['NSFW_MARKING'] = False

View File

@ -57,10 +57,10 @@ def end_lottery_session():
chance_to_win = str(chance_to_win)[:3]
if user.id == winner:
notification_text = f'You won {active_lottery.prize} coins in the lottershe! ' \
+ f'Congratulations!\nYour odds of winning were: {chance_to_win}%'
+ f'Congratulations!\n\nYour odds of winning were: {chance_to_win}%'
else:
notification_text = 'You did not win the lottershe. Better luck next time!\n' \
+ f'Your odds of winning were: {chance_to_win}%\nWinner: @{winning_user.username} (won {active_lottery.prize} coins)'
notification_text = 'You did not win the lottershe. Better luck next time!\n\n' \
+ f'Your odds of winning were: {chance_to_win}%\n\nWinner: @{winning_user.username} (won {active_lottery.prize} coins)'
send_repeatable_notification(user.id, notification_text)
user.currently_held_lottery_tickets = 0

View File

@ -183,15 +183,15 @@ def spin_roulette_wheel():
gambler.pay_account('marseybux', procoin_winnings)
# Notify the winners.
notification_text = f"Winning number: {number}\nCongratulations! One or more of your roulette bets paid off!\n"
notification_text = f"Winning number: {number}\n\nCongratulations! One or more of your roulette bets paid off!\n\n"
if coin_winnings > 0:
notification_text = notification_text + \
f"* You received {coin_winnings} coins.\n"
f"* You received {coin_winnings} coins.\n\n"
if procoin_winnings > 0:
notification_text = notification_text + \
f"* You received {procoin_winnings} marseybux.\n"
f"* You received {procoin_winnings} marseybux.\n\n"
send_repeatable_notification(user_id, notification_text)
@ -199,7 +199,7 @@ def spin_roulette_wheel():
for participant in participants:
if not participant in winners:
send_repeatable_notification(
participant, f"Winning number: {number}\nSorry, none of your recent roulette bets paid off.")
participant, f"Winning number: {number}\n\nSorry, none of your recent roulette bets paid off.")
g.db.flush()

View File

@ -157,7 +157,7 @@ def approve_marsey(v, name):
g.db.add(author)
if v.id != author.id:
msg = f"@{v.username} (a site admin) has approved a marsey you made: :{marsey.name}:\nYou have received 250 coins as a reward!"
msg = f"@{v.username} (a site admin) has approved a marsey you made: :{marsey.name}:\n\nYou have received 250 coins as a reward!"
send_repeatable_notification(author.id, msg)
if v.id != marsey.submitter_id and author.id != marsey.submitter_id:

View File

@ -167,7 +167,7 @@ def admin_app_approve(v, aid):
g.db.add(new_auth)
send_repeatable_notification(user.id, f"@{v.username} (a site admin) has approved your application `{app.app_name}`. Here's your access token: `{access_token}`\nPlease check the guide [here](/api) if you don't know what to do next!")
send_repeatable_notification(user.id, f"@{v.username} (a site admin) has approved your application `{app.app_name}`. Here's your access token: `{access_token}`\n\nPlease check the guide [here](/api) if you don't know what to do next!")
ma = ModAction(
kind="approve_app",

View File

@ -321,7 +321,7 @@ def downvoting(v:User, username:str):
@auth_required
def suicide(v:User, username:str):
user = get_user(username)
suicide = f"Hi there,\n\nA [concerned user](/id/{v.id}) reached out to us about you.\n\nWhen you're in the middle of something painful, it may feel like you don't have a lot of options. But whatever you're going through, you deserve help and there are people who are here for you.\n\nThere are resources available in your area that are free, confidential, and available 24/7:\n\n- Call, Text, or Chat with Canada's [Crisis Services Canada](https://www.crisisservicescanada.ca/en/)\n- Call, Email, or Visit the UK's [Samaritans](https://www.samaritans.org/)\n- Text CHAT to America's [Crisis Text Line](https://www.crisistextline.org/) at 741741.\nIf you don't see a resource in your area above, the moderators keep a comprehensive list of resources and hotlines for people organized by location. Find Someone Now\n\nIf you think you may be depressed or struggling in another way, don't ignore it or brush it aside. Take yourself and your feelings seriously, and reach out to someone.\n\nIt may not feel like it, but you have options. There are people available to listen to you, and ways to move forward.\n\nYour fellow users care about you and there are people who want to help."
suicide = f"Hi there,\n\nA [concerned user](/id/{v.id}) reached out to us about you.\n\nWhen you're in the middle of something painful, it may feel like you don't have a lot of options. But whatever you're going through, you deserve help and there are people who are here for you.\n\nThere are resources available in your area that are free, confidential, and available 24/7:\n\n- Call, Text, or Chat with Canada's [Crisis Services Canada](https://www.crisisservicescanada.ca/en/)\n\n- Call, Email, or Visit the UK's [Samaritans](https://www.samaritans.org/)\n\n- Text CHAT to America's [Crisis Text Line](https://www.crisistextline.org/) at 741741.\n\nIf you don't see a resource in your area above, the moderators keep a comprehensive list of resources and hotlines for people organized by location. Find Someone Now\n\nIf you think you may be depressed or struggling in another way, don't ignore it or brush it aside. Take yourself and your feelings seriously, and reach out to someone.\n\nIt may not feel like it, but you have options. There are people available to listen to you, and ways to move forward.\n\nYour fellow users care about you and there are people who want to help."
if not v.shadowbanned:
send_notification(user.id, suicide)
return {"message": f"Help message sent to @{user.username}"}

View File

@ -20,7 +20,7 @@ def worker_abort(worker):
worker.log.warning(f"User: {u.username!r} id:{u.id}")
else:
worker.log.warning(f"User: not logged in")
worker.log.warning(f"\n★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★\n")
worker.log.warning(f"\n\n★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★\n\n")
else:
worker.log.warning("No request info")
except: