actually get names from db

This commit is contained in:
Von Random 2024-11-21 16:02:52 +02:00
parent 9360efdce1
commit 9efc01878c

View file

@ -95,13 +95,15 @@ class Responder:
result = response result = response
if '<username>' in response: if '<username>' in response:
sender = await event.get_sender() sender = await event.get_sender()
result = result.replace('<username>', sender) username = self.namegen.get_name(sender)
result = result.replace('<username>', username)
result += ' I AM TEST' result += ' I AM TEST'
if '<randomname>' in response: if '<randomname>' in response:
peer_id = event.message.peer_id peer_id = event.message.peer_id
users = await self.client.get_participants(entity=peer_id) users = await self.client.get_participants(entity=peer_id)
victim = random.choice(users)[0] victim = random.choice(users)[0]
result = result.replace('<randomname>', victim) username = self.namegen.get_name(victim)
result = result.replace('<randomname>', username)
return result return result
async def respond(self, async def respond(self,