actually get names from db
This commit is contained in:
parent
9360efdce1
commit
9efc01878c
1 changed files with 4 additions and 2 deletions
|
@ -95,13 +95,15 @@ class Responder:
|
|||
result = response
|
||||
if '<username>' in response:
|
||||
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'
|
||||
if '<randomname>' 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('<randomname>', victim)
|
||||
username = self.namegen.get_name(victim)
|
||||
result = result.replace('<randomname>', username)
|
||||
return result
|
||||
|
||||
async def respond(self,
|
||||
|
|
Loading…
Reference in a new issue