diff --git a/subathon/component.py b/subathon/component.py index 9573dad..002c3f5 100644 --- a/subathon/component.py +++ b/subathon/component.py @@ -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()