-
-
Couldn't load subscription status.
- Fork 731
fix: check for unknown/None content_type for pastebin uploader #3413
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
fix: check for unknown/None content_type for pastebin uploader #3413
Conversation
| for attachment in message.attachments: | ||
| if ( | ||
| attachment.content_type | ||
| and attachment.content_type.startswith("text/plain") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also want to offer to upload files like text/csv or application/json, I think having a charset is enough to offer to upload it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm, should I check that the charset actually equals utf-8?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nevermind, didn't notice that was already checked in https://github.com/onerandomusername/pydis-bot/blob/main/bot/exts/utils/attachment_pastebin_uploader.py#L40-L41
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
6f3e8bb to
46e87ea
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
Converted to draft for now as I forgot to add checking for the other use mentioned in the attached issue: bot/bot/exts/filtering/filtering.py Line 238 in f0e4d45
|
|
fixed the attribute error in filtering and marked as ready for review again |
closes #3402