Add link command

This commit is contained in:
2025-09-24 09:40:42 +10:00
parent 21b1f9c3ab
commit a82b58b2c4

View File

@@ -257,7 +257,7 @@ class SubathonComponent(cmds.Component):
duration = strfdelta(timedelta(seconds=dursecs))
secs = await active.get_remaining()
if secs >= 0:
if secs > 0:
remaining = strfdelta(timedelta(seconds=secs))
text = (
@@ -334,6 +334,21 @@ class SubathonComponent(cmds.Component):
else:
await ctx.reply("No active subathon to stop.")
# subathon link
@group_subathon.command(name='link')
@cmds.is_moderator()
async def cmd_link(self, ctx: cmds.Context):
community = await self.bot.profiles.fetch_community(ctx.broadcaster)
cid = community.communityid
if (active := await self.get_active_subathon(cid)) is not None:
base_timer_url = self.bot.config.subathon['timer_url']
timer_link = f"{base_timer_url}?community={cid}"
await ctx.reply(
timer_link
)
else:
await ctx.reply("No active subathon to stop.")
# subathon pause
@group_subathon.command(name='pause')
@cmds.is_moderator()