Added discord bot object to complete game function
This commit is contained in:
parent
b3fa68b80e
commit
a4adf50ca1
@ -160,7 +160,7 @@ class Gameplay(commands.Cog):
|
|||||||
|
|
||||||
if submit_game:
|
if submit_game:
|
||||||
logger.info(f'post_play - is_game_over - {interaction.user.display_name} rejected game completion')
|
logger.info(f'post_play - is_game_over - {interaction.user.display_name} rejected game completion')
|
||||||
await complete_game(session, interaction, this_play)
|
await complete_game(session, interaction, this_play, self.bot)
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
logger.warning(f'post_play - is_game_over - {interaction.user.display_name} rejected game completion in Game {this_play.game.id}')
|
logger.warning(f'post_play - is_game_over - {interaction.user.display_name} rejected game completion in Game {this_play.game.id}')
|
||||||
|
|||||||
@ -3353,7 +3353,7 @@ async def get_game_summary_embed(session: Session, interaction: discord.Interact
|
|||||||
return game_embed
|
return game_embed
|
||||||
|
|
||||||
|
|
||||||
async def complete_game(session: Session, interaction: discord.Interaction, this_play: Play):
|
async def complete_game(session: Session, interaction: discord.Interaction, this_play: Play, bot: discord.Client = None):
|
||||||
# if interaction is not None:
|
# if interaction is not None:
|
||||||
# salutation = await interaction.channel.send('GGs, I\'ll tally this game up...')
|
# salutation = await interaction.channel.send('GGs, I\'ll tally this game up...')
|
||||||
# Add button with {winning_team} wins! and another with "Roll Back"
|
# Add button with {winning_team} wins! and another with "Roll Back"
|
||||||
@ -3432,7 +3432,7 @@ async def complete_game(session: Session, interaction: discord.Interaction, this
|
|||||||
run_id=int(this_game.game_type.split('-')[3]),
|
run_id=int(this_game.game_type.split('-')[3]),
|
||||||
is_win=winning_team.gmid == interaction.user.id,
|
is_win=winning_team.gmid == interaction.user.id,
|
||||||
this_team=this_game.human_team,
|
this_team=this_game.human_team,
|
||||||
bot=None,
|
bot=bot,
|
||||||
channel=interaction.channel,
|
channel=interaction.channel,
|
||||||
responders=[interaction.user]
|
responders=[interaction.user]
|
||||||
)
|
)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user