diff --git a/pyproject.toml b/pyproject.toml index 481b011a..4f5df0a8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ [tool.poetry] name = "royalpack" - version = "5.7.0" + version = "5.7.1" description = "A Royalnet command pack for the Royal Games community" authors = ["Stefano Pigozzi "] license = "AGPL-3.0+" diff --git a/royalpack/commands/matchmaking.py b/royalpack/commands/matchmaking.py index 645185f0..548f24c5 100644 --- a/royalpack/commands/matchmaking.py +++ b/royalpack/commands/matchmaking.py @@ -2,6 +2,7 @@ import datetime import re import dateparser import typing +import asyncio from telegram import Bot as PTBBot from telegram import Message as PTBMessage from telegram import InlineKeyboardMarkup as InKM @@ -83,6 +84,8 @@ class MatchmakingCommand(Command): return text def _gen_telegram_keyboard(self, mmevent: MMEvent): + if mmevent.datetime <= datetime.datetime.now(): + return None return InKM([ [ InKB(f"{MMChoice.YES.value} Ci sarò!", @@ -130,7 +133,7 @@ class MatchmakingCommand(Command): mmresponse.choice = choice await data.session_commit() await self._update_telegram_mm_message(client, mmevent) - return f"✅ Messaggio ricevuto!" + await data.reply(f"✅ Messaggio ricevuto!") return callback @@ -252,7 +255,8 @@ class MatchmakingCommand(Command): disable_webpage_preview=True) else: raise UnsupportedError() - # Delete the event message + # Delete the event message after 10 minutes + await asyncio.sleep(600) if self.interface.name == "telegram": await self.interface.serf.api_call(client.delete_message, chat_id=mmevent.interface_data.chat_id, diff --git a/royalpack/version.py b/royalpack/version.py index 56feeb31..d25d2258 100644 --- a/royalpack/version.py +++ b/royalpack/version.py @@ -1 +1 @@ -semantic = "5.7.0" +semantic = "5.7.1"