discord-jda / JDA

Java wrapper for the popular chat & VOIP service: Discord https://discord.com
Apache License 2.0
4.35k stars 734 forks source link

sendFile on a Nitro Boosted Guild #1243

Closed zoemartin01 closed 4 years ago

zoemartin01 commented 4 years ago

General Troubleshooting

Feature Request

As the sendFile(File, String, AttachmentOption) Method is not overwritten in TextChannel it uses the MessageChannel method which checks only checks the users max. allowed file size but not the servers. On a Server with nitro boost level 2/3 that check isn't accurate anymore because also non-nitro users and bots can send attachments as big as 50MiB or 100MiB respectively.

default MessageAction sendFile(@Nonnull File file, @Nonnull String fileName, @Nonnull AttachmentOption... options) {
...
Checks.check(file.length() <= getJDA().getSelfUser().getAllowedFileSize(),
                "File is too big! Max file-size is 8 MiB for normal and 50 MiB for nitro users");
...
}
Andre601 commented 4 years ago

From what I understand is there no confirmation in the docs, that would proof, that the boost level also influences the file-size a bot can upload.

If you find a clear confirmation within the official docs, that proof this, then please provide us the link.

Andre601 commented 4 years ago

Additionally does JDA use the SelfUser and not the SelfMember as shown by your code-snipped. This is most likely because the Member Object doesn't have an option to see what the file-size is, that they can upload.

I can't even find any kind of documentation that would list limitations of the attachments a bot can upload.

zoemartin01 commented 4 years ago

The official documentation isn't well detailed when it comes to boost tier perks. I cannot find anything stating the specific tier perks in the developer portal. The only thing that comes close is this screenshot I took in the app itself, when looking at a Guilds boost tab. Screenshot 2020-03-27 at 16 20 28

sebm253 commented 4 years ago

The question is if boost tiers limit bots.

zoemartin01 commented 4 years ago

Well I know that bots are also affected by the 100MiB limit for a level 3 Guild since I built my own JDA version with the check removed, tried it on my server and it works with files > 8MiB. But I don't have any official documentation for that.

Andre601 commented 4 years ago

Well I know that bots are also affected by the 100MiB limit for a level 3 Guild since I built my own JDA version with the check removed, tried it on my server and it works with files > 8MiB. But I don't have any official documentation for that.

Without any official documentation confirming this will that probably not be changes because it could also be a bug in the eyes of the Discord Devs and could therefore be fixed I suggest you open an issue on the GitHub about the API-docs to propose adding this information to said docs, so that we have a confirmation on Discord's side that this indeed is intended behaviour.

MinnDevelopment commented 4 years ago

I'm pretty sure all the boost benefits also apply to bots.