Skip to content

Commit

Permalink
Store the timer's ID only
Browse files Browse the repository at this point in the history
  • Loading branch information
LightSage committed Aug 7, 2023
1 parent c55f4e4 commit 0a12a62
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lightning/cogs/mod/cog.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ async def time_ban_user(self, ctx: GuildContext, target, moderator, reason, dura
raise TimersUnavailable

tzinfo = await cog.get_user_tzinfo(ctx.author.id)
job_id = await cog.add_timer("timeban", ctx.message.created_at, duration.dt, guild_id=ctx.guild.id,
user_id=target.id, mod_id=moderator.id, force_insert=True, timezone=tzinfo)
created_timer = await cog.add_timer("timeban", ctx.message.created_at, duration.dt, guild_id=ctx.guild.id,
user_id=target.id, mod_id=moderator.id, force_insert=True, timezone=tzinfo)

if dm_user and isinstance(target, discord.Member):
dm_message = modlogformats.construct_dm_message(target, "banned", "from", reason=reason,
Expand All @@ -183,7 +183,7 @@ async def time_ban_user(self, ctx: GuildContext, target, moderator, reason, dura
await ctx.guild.ban(target, reason=self.format_reason(ctx.author, opt_reason),
delete_message_days=delete_message_days)
await self.confirm_and_log_action(ctx, target, "TIMEBAN", duration_text=duration_text,
expiry=duration.dt, timer_id=job_id)
expiry=duration.dt, timer=created_timer['id'])

@lflags.add_flag("--nodm", "--no-dm", is_bool_flag=True,
help="Bot does not DM the user the reason for the action.")
Expand Down

0 comments on commit 0a12a62

Please sign in to comment.