From 442b9b78bb564f530e7f4cdd6a47c9025a4b5ac4 Mon Sep 17 00:00:00 2001 From: Von Random Date: Fri, 22 Nov 2024 19:52:41 +0200 Subject: [PATCH] fix async function and some vars --- pgbotlib/cron.py | 2 +- pgbotlib/response.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pgbotlib/cron.py b/pgbotlib/cron.py index 398fbae..9481c0d 100644 --- a/pgbotlib/cron.py +++ b/pgbotlib/cron.py @@ -36,7 +36,7 @@ class Cron: await asyncio.sleep(wait_seconds) message = self.responder.get_response(tokens) 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) return send_message diff --git a/pgbotlib/response.py b/pgbotlib/response.py index c93d041..755a265 100644 --- a/pgbotlib/response.py +++ b/pgbotlib/response.py @@ -106,7 +106,7 @@ class Responder: users = await self.client.get_participants(entity=chat_id) victim = random.choice(users) username = self.namegen.get_name(victim) - return response.replace('', username) + return response.replace(marker, username) async def respond(self, event: telethon.events.common.EventBuilder) -> None: