diff --git a/docs/source/changelog.rst b/docs/source/changelog.rst index 02e217b..f77330c 100644 --- a/docs/source/changelog.rst +++ b/docs/source/changelog.rst @@ -4,6 +4,9 @@ Changelog ========= +- :release:`2.2.0 <5th May 2023>` +- :feature:`57` Add force option to Dragonfly stop command + - :release:`2.1.0 <3rd May 2023>` - :feature:`59` Add slash command to bring up package modal on demand diff --git a/pyproject.toml b/pyproject.toml index 1ec49a0..0333542 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "alessia" -version = "2.1.0" +version = "2.2.0" dependencies = [ "python-dotenv==1.0.0", "discord.py==2.2.2", diff --git a/src/bot/exts/dragonfly/dragonfly.py b/src/bot/exts/dragonfly/dragonfly.py index 1606d4f..a58c143 100644 --- a/src/bot/exts/dragonfly/dragonfly.py +++ b/src/bot/exts/dragonfly/dragonfly.py @@ -301,10 +301,14 @@ async def start(self, ctx: commands.Context) -> None: await ctx.send("Started task...") @commands.command() - async def stop(self, ctx: commands.Context) -> None: + async def stop(self, ctx: commands.Context, force: bool = False) -> None: if self.scan_loop.is_running(): - self.scan_loop.stop() - await ctx.send("Stopping task...") + if force: + self.scan_loop.cancel() + await ctx.send("Forcing shutdown...") + else: + self.scan_loop.stop() + await ctx.send("Executing graceful shutdown...") else: await ctx.send("Task is not running.")