fixing blackjack and improving lookup

This commit is contained in:
Nikolaj
2022-01-28 11:33:47 +01:00
parent cbf2ca765e
commit 05cd5831e1
10 changed files with 219 additions and 160 deletions

View File

@ -22,7 +22,7 @@ class GameBase():
self.long_strings = self.bot.long_strings
self.resources = "gwendolyn/resources/games/"
self.game_name = game_name
self.draw = drawer
self.draw = drawer(bot, self)
def _get_action_rows(self, buttons: list[tuple[str, list]]):
self.bot.log("Generation action rows")
@ -100,7 +100,7 @@ class DatabaseGame(GameBase):
async def _send_image(self, channel: Messageable,
buttons: list[tuple[str, list]] = None, delete=True):
old_image = super()._send_image(channel, buttons, delete)
old_image = await super()._send_image(channel, buttons, delete)
with open(self.old_images_path + str(channel.id), "w") as file_pointer:
file_pointer.write(str(old_image.id))
@ -153,7 +153,7 @@ class CardGame(DatabaseGame):
return drawn_card
class BoardGame(GameBase):
def _test_opponent(self, ctx: IntCont, opponent: Union[int, User]):
async def _test_opponent(self, ctx: IntCont, opponent: Union[int, User]):
if isinstance(opponent, int):
# Opponent is Gwendolyn
if opponent in range(1, 6):