diff --git a/docs/source/changelog.rst b/docs/source/changelog.rst index f77330c..ae3d030 100644 --- a/docs/source/changelog.rst +++ b/docs/source/changelog.rst @@ -4,6 +4,9 @@ Changelog ========= +- :release:`2.3.0 <5th May 2023>` +- :feature:`18` Log auto-reports + - :release:`2.2.0 <5th May 2023>` - :feature:`57` Add force option to Dragonfly stop command diff --git a/pyproject.toml b/pyproject.toml index 0333542..3d3b352 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "alessia" -version = "2.2.0" +version = "2.3.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 a58c143..d3b9f56 100644 --- a/src/bot/exts/dragonfly/dragonfly.py +++ b/src/bot/exts/dragonfly/dragonfly.py @@ -73,6 +73,21 @@ async def on_submit(self, interaction: discord.Interaction): ", ".join(DragonflyConfig.bcc), ) + log.info( + "User %s reported package %s with description %s", + interaction.user, + self.package.name, + self.description, + ) + + log_channel = interaction.client.get_channel(DragonflyConfig.logs_channel_id) + if isinstance(log_channel, discord.abc.MessageableChannel): + await log_channel.send( + f"User {interaction.user.mention} " + f"reported package `{self.package.name}` " + f"with description `{self.description}`" + ) + await interaction.response.send_message("Successfully sent report.", ephemeral=True) send_email(