File size: 2,254 Bytes
a7d7463
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
"""Thanking Message Generator"""

import random
from datetime import datetime


class ThankingMessageGenerator:
    """Generate variety of thank you messages"""

    EMOJIS = ["🙏", "💖", "⭐", "✨", "🌟", "💫", "🎉", "🙏"]

    GREETINGS = [
        "Thank you for using",
        "Appreciate your interest in",
        "Grateful for your support of",
        "Thanks for trying",
    ]

    PRODUCT_NAME = "Burme-Coder-Max"

    FOLLOW_UPS = [
        "Keep coding!",
        "Happy coding!",
        "Let me know if you need more help!",
        "Feel free to ask follow-up questions!",
        "Happy learning!",
    ]

    @classmethod
    def generate(cls, include_emoji: bool = True) -> str:
        """Generate a random thank you message"""
        parts = []

        if include_emoji:
            parts.append(random.choice(cls.EMOJIS))
            parts.append(" ")

        parts.append(random.choice(cls.GREETINGS))
        parts.append(" ")
        parts.append(cls.PRODUCT_NAME)
        parts.append("!")

        if random.random() > 0.5:
            parts.append("\n")
            parts.append(random.choice(cls.FOLLOW_UPS))

        return "".join(parts)

    @classmethod
    def generate_detailed(cls, topic: str = None) -> dict:
        """Generate detailed appreciation message"""
        return {
            "message": cls.generate(),
            "topic": topic,
            "timestamp": datetime.now().isoformat(),
            "emoji": random.choice(cls.EMOJIS),
        }

    @classmethod
    def generate_stack(cls, count: int = 3) -> list:
        """Generate multiple thank you messages"""
        return [cls.generate() for _ in range(count)]


def main():
    """Demo the thank you generator"""
    print("=== Thanking Message Generator ===\n")

    generator = ThankingMessageGenerator()

    print("Single message:")
    print(generator.generate())
    print()

    print("With topic:")
    detailed = generator.generate_detailed("Python decorators")
    print(detailed["message"])
    print(f"Topic: {detailed['topic']}")
    print()

    print("Multiple messages (stack):")
    for i, msg in enumerate(generator.generate_stack(3), 1):
        print(f"{i}. {msg}")


if __name__ == "__main__":
    main()