From 3230a077d1dde5c267c21ead5e6e307550a2056a Mon Sep 17 00:00:00 2001 From: Mikkel Munch Mortensen <3xm@detfalskested.dk> Date: Wed, 12 Jul 2023 10:16:37 +0200 Subject: [PATCH] Expand introductions Add a new one for favourite dishes and introduce the possibitly to have replaceable tokens in introductions. --- frokostbot.py | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/frokostbot.py b/frokostbot.py index bbe2ab0..0c51c1a 100644 --- a/frokostbot.py +++ b/frokostbot.py @@ -157,6 +157,7 @@ else: for emoji, keywords in { "flag-in": ["indisk", "indien"], "flag-gr": ["græsk", "grækenland"], + "flag-kr": ["korea"], "hushed": ["surprise", "surprice"], "fish": ["fisk", "laks", "rødspætte", "sej ", "kulmule"], "shrimp": ["reje"], @@ -184,11 +185,13 @@ else: "hamburger": ["burger"], "sandwich": ["sandwich"], "stuffed_flatbread": ["pita"], + "flatbread": ["naanbrød", " naan"], "pie": ["tærte"], - "hotdog": ["hotdog"], + "hotdog": ["hotdog", "pølse"], + "fries": ["fritter "], "wine_glass": ["coq au vin"], "bowl_with_spoon": ["suppe"], - "fire": ["grill", "brændt"], + "fire": ["grill", "brændt", "bbq"], "stew": ["gryde", "gullasch"], "rice": [" ris "], "ramen": ["nudler"], @@ -198,7 +201,7 @@ else: "apple": ["æble"], "peanuts": ["peanut"], "baguette_bread": ["flute"], - "flag-dk": ["tillykke", "fødselsdag"], + "birthday": ["tillykke", "fødselsdag"], "wave": ["farvel"], "gift_heart": ["valentines"], }.items(): @@ -214,6 +217,26 @@ else: sys.stdout.write("No emojis determined.\n") # Pick an introduction for the menu. + tokens = { + "persons": random.choice([ + "Abrahims", + "Elias'", + "Martins", + "Benjamins", + "Karstens", + "Josephines", + "Christians", + "Davids", + "Pias", + "Minas", + "Mariannes", + "Alexanders", + "Mettes", + "Jellings", + "Imers", + "Djinnies", + ]), + } introduction = random.choice( [ "Dagens menu er", @@ -221,8 +244,10 @@ else: "Du kan godt glæde dig til senere! For vi skal have", "Der bliver knoklet i køkkenet for at blive klar til at servere", "Klokken 11:30 har kantinen fremtryllet en lækker omgang", + "I dag skal vi have {persons} livret:", ] ) + introduction = introduction.format(**tokens) sys.stdout.write(f"Introduction picked: {introduction}\n") # Retrieve a photo of the menu from Craiyon.