Skip to content

Commit

Permalink
remove inmogi roles on close
Browse files Browse the repository at this point in the history
  • Loading branch information
probablyjassin committed Nov 10, 2024
1 parent fd6f39b commit 95ec141
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions cogs/mogi/calculations.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ async def apply(self, ctx: MogiApplicationContext):
await update_roles(ctx, ctx.mogi)

ctx.mogi.finish()
for player in ctx.mogi.players:
(await ctx.guild.fetch_member(player.discord_id)).remove_roles(
ctx.inmogi_role
)
mogi_manager.destroy_mogi(ctx.channel.id)
return await ctx.respond("# This channel's Mogi is finished and closed.")

Expand Down
7 changes: 6 additions & 1 deletion cogs/mogi/mogi.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@ async def close(self, ctx: MogiApplicationContext):
)

if await confirmation(ctx, close_confirm_message):
mogi_manager.destroy_mogi(ctx.channel.id)
for player in ctx.mogi.players:
(await ctx.guild.fetch_member(player.discord_id)).remove_roles(
ctx.inmogi_role
)

mogi_manager.destroy_mogi(ctx.mogi.channel_id)
return await ctx.respond("# This channel's Mogi has been closed.")

await ctx.respond("Cancelled.")
Expand Down

0 comments on commit 95ec141

Please sign in to comment.