Skip to content

Show attachments in staff log#303

Merged
jchristgit merged 14 commits into
masterfrom
bot#549-show-attachments-staff
Jan 13, 2020
Merged

Show attachments in staff log#303
jchristgit merged 14 commits into
masterfrom
bot#549-show-attachments-staff

Conversation

@Akarys42
Copy link
Copy Markdown
Contributor

@Akarys42 Akarys42 commented Oct 28, 2019

Hi, this PR show the attachments along with the original message in staff logs (https://staff.pythondiscord.com/bot/logs/...). python-discord/bot#630 need to be merged after this one for the feature to work.

This PR closes python-discord/bot#549

Before

before

After

after

@SebastiaanZ
Copy link
Copy Markdown
Contributor

Did you test what happens to these attachment links when a message has been deleted (for a while)? I can imagine Discord not keeping attachments around if they're attached to a message anymore.

@Akarys42
Copy link
Copy Markdown
Contributor Author

Akarys42 commented Oct 28, 2019 via email

@SebastiaanZ
Copy link
Copy Markdown
Contributor

I've just tested it and the attachments are basically inaccessible as soon as the message gets deleted. That means I don't really see the point in adding the URLs to the database. I did not consider that the other day when I commented on the issue, but I don't think this is a suitable solution.

@Akarys42
Copy link
Copy Markdown
Contributor Author

Akarys42 commented Oct 28, 2019 via email

@Akarys42
Copy link
Copy Markdown
Contributor Author

I did more research and here is what I found (again, I’m not a lawyer).

Discord developer ToS

2.1 API or SDK licence

Subject to the terms and conditions of this Agreement, Discord grants you a limited, non-exclusive, revocable, non-transferable license to access and use the API or SDK solely to as necessary to (i) develop, test, display and execute your Applications with the API or SDK functionality included; and (ii) distribute to third parties, or permit third parties to access, the API or SDK as integrated into your Applications.

2.4 End User data

“End User Data” means all data associated with the content within the functionality enabled by the API or SDK, including but not limited to message content, message metadata, voice data and voice metadata. You acknowledge and agree that Discord and its end users, as applicable, retain all worldwide right, title and interest in and to the End User Data. If you have access to End User Data through the API or the SDK, you shall ensure that your Applications do not collect, use and/or disclose End User Data except (a) as necessary to exercise your rights under this Agreement, (b) in accordance with Discord’s Privacy Policy. If you have access to End User Data through the SDK, you additionally agree to get express permission from the End Users.

You shall not sell, license or otherwise commercialize any End User Data. You may not use End User Data to target End Users for marketing or advertising purposes. You may not disclose End User Data to any ad network, data broker or other advertising or monetization related service.

You shall delete all End User Data upon Discord’s or the End User’s request and within seven (7) days following the End User’s termination of the End User’s account. You may only retain chat logs as necessary for the operation of your Applications. Discord’s offering of an API or SDK that allows you to reproduce or display End User message content is not an express or implied license to such content from Discord.

My point of view

From what I understand, we can’t use the end user data, including attachments, except for exercising our rights (2.4a). Using the API functionalities to produce our services are part of our rights (2.1), so we should be able to store attachments.

Solutions

We can either

  • Store the attachments in the database, but attachments can be up to 100Mo, which is a lot to store (although if the database is on a block storage, that’s not a problem)
  • Make the bot repost the attachments in a private channel, and use the new link. I think this option is also more safe from a legal point, because all the data stay on discord’s servers.

@ikuyarihS
Copy link
Copy Markdown

Hmm, how about reuploading the attachments to the mod log, then use that link instead? That way we can access it much later as well, and discord will maintain it.

@Akarys42
Copy link
Copy Markdown
Contributor Author

@SebastiaanZ said some mods wouldn’t want all the attachments to appear in mod-log or mod-alert, because that take too much place (tbh I kind of agree with them), this is why I suggested to create a special bot-only channel.

Copy link
Copy Markdown
Contributor

@MarkKoz MarkKoz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be a test for the attachment images being in the HTML, similar to the embed tests.

@Akarys42 Akarys42 requested a review from MarkKoz November 20, 2019 17:22
@SebastiaanZ
Copy link
Copy Markdown
Contributor

@Akarys42 Another channel just for the occasional image attachment relay seems a bit like overkill to me. That means we'd have a mostly empty channel and there are already a lot of channels in that log category for moderators.

Since we're deleting messages, maybe we should make an exception and have the attachments relayed to message-change-log. We normally suppress bulk deletions (like the antispam deletions), but having those attachments relayed there wouldn't be too bad. I think (I hope) most mods have that channel muted since it has a huge volume, so the occasional attachment being relayed there probably wouldn't hurt anyone.

@SebastiaanZ
Copy link
Copy Markdown
Contributor

Okay, maybe we should just open another channel. I'm going to discuss this with the admins/mods to gauge everyone's preferences.

@MarkKoz MarkKoz added the type: feature New feature or request label Dec 15, 2019
Copy link
Copy Markdown
Contributor

@jchristgit jchristgit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your migration conflicts with 0049_offensivemessage.py. Can you update to the latest master?

@jchristgit jchristgit self-assigned this Jan 12, 2020
@Akarys42 Akarys42 requested a review from jchristgit January 13, 2020 12:08
@Akarys42
Copy link
Copy Markdown
Contributor Author

Done! @jchristgit

Copy link
Copy Markdown
Contributor

@jchristgit jchristgit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit: :shipit: :shipit: :shipit: :shipit:

@jchristgit jchristgit merged commit e35529d into master Jan 13, 2020
@jchristgit jchristgit deleted the bot#549-show-attachments-staff branch January 13, 2020 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: API Related to or causes API changes area: frontend Related to site content and user interaction type: feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Message filtering did not account for message with only attachments

5 participants