add darrellposting

master
HeyMoon 2022-10-22 16:36:52 -05:00
parent 5362f8374c
commit 5c868d7aa7
1 changed files with 44 additions and 6 deletions

View File

@ -42,6 +42,26 @@ ANTISPAM_MESSAGES = [
'idk what u mean by mommy milkers 😭 im not ur mommy pls stop saying that',
'goldstein sama is so cute ~ what a cute nose... urs is fine to tho'
]
DARRELL_QUOTES = [
":#marseyobjection: \nFor the record, your honor, I do not consent to being called that name, nor do I know anyone by that name",
":#brooksannoyed: \nI see what you're doing. You must think you're slick.",
":#marseyobjection: \nThe jury deserves to know, your honor.",
":#marseyjurisdiction: \nCan we please address :marseyjurisdiction:?",
":#marseygrouns:",
":#marseygrouns:\n:marseygrouns: for the substain?",
":#marseyrelevancy:\nuhh what's the :marseyrelevancy:?",
":#brooksannoyed:\nYour honor, that's a load of crap.",
":#marseytakit:\nIs that lawfully law?",
":#marseytakit:\nIs that a :marseytakit:?",
":#brooksannoyed:\nI AM A GROWN MAN WITH GROWN KIDS AINT NOBODY TELL ME WHEN TO TALK",
":#marseybiast:\nIs this a common law court or an admiralty court?",
]
DARRELL_KEYWORDS = [
"brooks",
"darrell"
]
DARRELL_DISCLAIMER = "_I am not Darrell Brooks, I am a third party intervener, here on behalf of my client_"
TEST_MODE = False
DRY_MODE = False
@ -54,12 +74,13 @@ AUTOMEME_ID = 13427
ALLOWED_COMMENTS_PER_POST = 20
ALLOWED_COMMENTS_PER_USER_PER_DAY = 20
SOY_VS_CHAD_TRIGGER_CHANGE = 0.5
MODERN_MEME_WITH_MARSEY_TRIGGER_CHANGE = 0.01
MODERN_MEME_WITH_IMAGE_TRIGGER_CHANGE = 0.05
CLASSIC_MEME_WITH_MARSEY_TRIGGER_CHANGE = 0.02
CLASSIC_MEME_WITH_IMAGE_TRIGGER_CHANGE = 0.1
WEBCOMIC_TRIGGER_CHANCE = 0.5
SOY_VS_CHAD_TRIGGER_CHANGE = 0.01
MODERN_MEME_WITH_MARSEY_TRIGGER_CHANGE = 0.001
MODERN_MEME_WITH_IMAGE_TRIGGER_CHANGE = 0.005
CLASSIC_MEME_WITH_MARSEY_TRIGGER_CHANGE = 0.002
CLASSIC_MEME_WITH_IMAGE_TRIGGER_CHANGE = 0.001
WEBCOMIC_TRIGGER_CHANCE = 0.01
DARRELL_CHANCE = 1.0
FREE_POSTS = [6, 97416, 98286]
RESTRICTED_POSTS = [5, 16583, 75878, 35835]
@ -464,11 +485,28 @@ def handle_comment(comment : dict, rdrama : RDramaAPIInterface, session : Sessio
print(f"[{comment['id']}] is a free post.")
end = datetime.now()
print(end-begin)
elif comment_contains_keyword(comment_text, DARRELL_KEYWORDS):
if random_float <= DARRELL_CHANCE:
message = choice(DARRELL_QUOTES)
message += "\n\n"
message += DARRELL_DISCLAIMER
message += f"<source src=\"{''.join(choices(['a','b','c','d','f','g','h','j','k','l','m','n','p','q','r','s','t','v','w','x','z'], k=500))}.mp3\">"
post_id = comment['post_id']
user_id = 0 if comment['author'] == '👻' else comment['author']['id']
new_comment_id = rdrama.reply_to_comment_easy(comment['id'], post_id, message)['id']
Comment.create_new_comment(comment['id'], new_comment_id, session)
Post.increment_replies(post_id, session)
User.increase_number_of_comments(user_id, session)
else:
Comment.create_new_comment(comment['id'], None, session)
except BaseException as e:
print(f"YIKERINOS! GOT AN EXCEPTION: {e}")
traceback.print_exc()
def comment_contains_keyword(comment, keywords):
comment_words = comment.lower().split(" ")
return len(set.intersection(set(comment_words), set(keywords))) != 0
def main_processing_task(rdrama : RDramaAPIInterface, session : Session):
is_chudded = False #Do we have the chud award?
can_communicate = True #Can we send any message at all?