From cc2268afd8c00089d12f9bc6ce56fac731ea1f35 Mon Sep 17 00:00:00 2001 From: retoor Date: Mon, 16 Dec 2024 23:25:59 +0100 Subject: [PATCH] Made random boehh generator. --- src/boeh/__init__.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/boeh/__init__.py b/src/boeh/__init__.py index 82f2709..bc4711d 100644 --- a/src/boeh/__init__.py +++ b/src/boeh/__init__.py @@ -1,7 +1,18 @@ from nio import AsyncClient, RoomMessageText - +import random class BooeehBot: + + def generate_boeh(self): + boeh = "b" + for _ in range(random.randint(1, 10)): + boeh += "o" + for _ in range(random.randint(1, 5)): + boeh += "e" + for _ in range(random.randint(1, 3)): + boeh += "e" + return boeh + def __init__(self, url, username, password): self.url = url self.username = username @@ -11,7 +22,7 @@ class BooeehBot: async def login(self): try: response = await self.client.login(self.password) - print(f"User logged in: {self.username}") + print(f"Logged in. Serving {self.username}.") return response except Exception as e: print(f"Login error: {e}") @@ -22,7 +33,7 @@ class BooeehBot: if isinstance(event, RoomMessageText): if event.sender == specific_user_id: - response_text = "booeeeh" + response_text = self.generate_boeh() try: await self.client.room_send( room.room_id,