Skip to content

Commit

Permalink
Update timekiller.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Nurdok authored Oct 27, 2024
1 parent dfd9bd7 commit e654ae1
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions src/spanreed/plugins/timekiller.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,18 +90,11 @@ async def _kill_time_push(self, user: User) -> None:
"""
obsidian: ObsidianApi = await ObsidianApi.for_user(user)
bot: TelegramBotApi = await TelegramBotApi.for_user(user)
while True:
timekillers: dict = await self.get_available_time_killers(
user, obsidian
)
choice: str = random.choice(list(timekillers.keys()))
await timekillers[choice](user, bot, obsidian)
if (
await bot.request_user_choice(
"Another?", ["Yes", "No"], columns=2
)
) == 1:
break
timekillers: dict = await self.get_available_time_killers(
user, obsidian
)
choice: str = random.choice(list(timekillers.keys()))
await timekillers[choice](user, bot, obsidian)

async def _kill_time(self, user: User) -> None:
obsidian: ObsidianApi = await ObsidianApi.for_user(user)
Expand Down

0 comments on commit e654ae1

Please sign in to comment.