Skip to content

Commit

Permalink
Log auto-reports (#65)
Browse files Browse the repository at this point in the history
* Add option to specify force task shutdown

* Bump version and update changelog

* Lint

* Log auto-reports

* Bump version and update changelog

* Update changelog

---------

Signed-off-by: Robin <[email protected]>
  • Loading branch information
Robin5605 authored May 6, 2023
1 parent 7caf47c commit a3a261b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
3 changes: 3 additions & 0 deletions docs/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
15 changes: 15 additions & 0 deletions src/bot/exts/dragonfly/dragonfly.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit a3a261b

Please sign in to comment.