fix async function and some vars

This commit is contained in:
Von Random 2024-11-22 19:52:41 +02:00
parent 8bbda6ae7a
commit 442b9b78bb
2 changed files with 2 additions and 2 deletions

View file

@ -36,7 +36,7 @@ class Cron:
await asyncio.sleep(wait_seconds) await asyncio.sleep(wait_seconds)
message = self.responder.get_response(tokens) message = self.responder.get_response(tokens)
message = self.responder.api_match(message, '') message = self.responder.api_match(message, '')
message = self.responder.rndm_tmpl(message, job['chat']) message = await self.responder.rndm_tmpl(message, job['chat'])
await self.client.send_message(job['chat'], message) await self.client.send_message(job['chat'], message)
return send_message return send_message

View file

@ -106,7 +106,7 @@ class Responder:
users = await self.client.get_participants(entity=chat_id) users = await self.client.get_participants(entity=chat_id)
victim = random.choice(users) victim = random.choice(users)
username = self.namegen.get_name(victim) username = self.namegen.get_name(victim)
return response.replace('<randomname>', username) return response.replace(marker, username)
async def respond(self, async def respond(self,
event: telethon.events.common.EventBuilder) -> None: event: telethon.events.common.EventBuilder) -> None: