From 8c3b6cece1d6da970506c107e91428a72e29be93 Mon Sep 17 00:00:00 2001 From: TLSM Date: Tue, 24 May 2022 19:08:41 -0400 Subject: [PATCH] Add 8-ball answers, like fortune & factcheck. --- files/helpers/const.py | 8 ++++++++ files/helpers/sanitize.py | 6 ++++++ files/templates/formatting.html | 5 +++++ 3 files changed, 19 insertions(+) diff --git a/files/helpers/const.py b/files/helpers/const.py index bd00ff994d..42c388c53f 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -730,6 +730,14 @@ NOTIFIED_USERS = { FORTUNE_REPLIES = ('Your fortune: Allah Wills It','Your fortune: Inshallah, Only Good Things Shall Come To Pass','Your fortune: Allah Smiles At You This Day','Your fortune: Your Bussy Is In For A Blasting','Your fortune: You Will Be Propositioned By A High-Tier Twink','Your fortune: Repent, You Have Displeased Allah And His Vengeance Is Nigh','Your fortune: Reply Hazy, Try Again','Your fortune: lmao you just lost 100 coins','Your fortune: Yikes 😬','Your fortune: You Will Be Blessed With Many Black Bulls','Your fortune: NEETmax, The Day Is Lost If You Venture Outside','Your fortune: A Taste Of Jannah Awaits You Today','Your fortune: Watch Your Back','Your fortune: Outlook good','Your fortune: Godly Luck','Your fortune: Good Luck','Your fortune: Bad Luck','Your fortune: Good news will come to you by mail','Your fortune: Very Bad Luck','Your fortune: キタ━━━━━━(οΎŸβˆ€οΎŸ)━━━━━━ !!!!','Your fortune: Better not tell you now','Your fortune: You will meet a dark handsome stranger','Your fortune: οΌˆγ€€Β΄_ゝ`οΌ‰οΎŒο½°οΎ','Your fortune: Excellent Luck','Your fortune: Average Luck') +EIGHTBALL_REPLIES = [('It is certain.', 0), ('It is decidedly so.', 0), ('Without a doubt.', 0), + ('Yes definitely.', 0), ('You may rely on it.', 0), ('As I see it, yes.', 0), + ('Most likely.', 0), ('Outlook good.', 0), ('Yes.', 0), ('Signs point to yes.', 0), + ('Reply hazy, try again.', 1), ('Ask again later.', 1), ('Better not tell you now.', 1), + ('Cannot predict now.', 1), ('Concentrate and ask again.', 1), ('Don’t count on it.', 2), + ('My reply is no.', 2), ('My sources say no.', 2), ('Outlook not so good.', 2), ('Very doubtful.', 2),] +EIGHTBALL_COLORS = ['#7FEC11', '#E7890C', '#FD4D32'] + FACTCHECK_REPLIES = ('Factcheck: This claim has been confirmed as correct by experts. ','Factcheck: This claim has been classified as misogynistic.','Factcheck: This claim is currently being debunked.','Factcheck: This claim is 100% true.','Factcheck: This claim hurts trans lives.','Factcheck: [REDACTED].','Factcheck: This claim is both true and false.','Factcheck: You really believe that shit? Lmao dumbass nigga 🀣','Factcheck: None of this is real.','Factcheck: Yes.','Factcheck: This claim has not been approved by experts.','Factcheck: This claim is a gross exageration of reality.','Factcheck: WARNING! THIS CLAIM HAS BEEN CLASSIFIED AS DANGEROUS. PLEASE REMAIN STILL, AN AGENT WILL COME TO MEET YOU SHORTLY.') if SITE_NAME == 'rDrama': patron = 'Paypig' diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index 05c5e608d9..9eba0fc942 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -281,6 +281,12 @@ def sanitize(sanitized, alert=False, comment=False, edit=False): sanitized = sanitized.replace('#fortune', '') sanitized += '\n\n

' + choice(FORTUNE_REPLIES) + '

' + if '#8ball' in sanitized: + (b8txt, b8knd) = choice(EIGHTBALL_REPLIES) + b8color = EIGHTBALL_COLORS[b8knd] + sanitized = sanitized.replace('#8ball', '') + sanitized += '\n\n

The 8-Ball Says: %s

' % (b8color, b8txt) + if '#factcheck' in sanitized: sanitized = sanitized.replace('#factcheck', '') sanitized += '\n\n

' + choice(FACTCHECK_REPLIES) + '

' diff --git a/files/templates/formatting.html b/files/templates/formatting.html index 46cae36fbf..fc811bd41d 100644 --- a/files/templates/formatting.html +++ b/files/templates/formatting.html @@ -121,6 +121,11 @@ Text 2 #fortune ??? + + Random 8-Ball Answer + #8ball + ??? (but less fun than #fortune) + Random Factcheck #factcheck