From 9efc01878c66a50731832e320dec233fae445f63 Mon Sep 17 00:00:00 2001 From: Von Random Date: Thu, 21 Nov 2024 16:02:52 +0200 Subject: [PATCH] actually get names from db --- pgbotlib/response.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pgbotlib/response.py b/pgbotlib/response.py index 06d38d7..1e56961 100644 --- a/pgbotlib/response.py +++ b/pgbotlib/response.py @@ -95,13 +95,15 @@ class Responder: result = response if '' in response: sender = await event.get_sender() - result = result.replace('', sender) + username = self.namegen.get_name(sender) + result = result.replace('', username) result += ' I AM TEST' if '' in response: peer_id = event.message.peer_id users = await self.client.get_participants(entity=peer_id) victim = random.choice(users)[0] - result = result.replace('', victim) + username = self.namegen.get_name(victim) + result = result.replace('', username) return result async def respond(self,