Suggestions and Issues for Improving the Library #2822
Replies: 1 comment
-
This is not an exceptional case and should not be throwing an exception. Using a null return for a getById makes a lot more sense and provides much better performance. The docs also clearly explain how they work. If you think the docs are lacking here, please feel free to contribute with a PR.
Out of scope for this library. We have no plans to support this due to the amount of work it would require to maintain. Feel free to open source your solution, so others can benefit from it.
This is because discord does not provide this information, our hands are tied. If you want this, then either make your own database of all messages or ask discord to add this to their events (but this will likely never happen).
We provide a ton of detailed information in our docs, can you give a single example? Feel free to PR any docs you think are missing. This is an open source library for a reason, contributions are welcome and much appreciated.
I don't understand what you mean here, if you mean that JDA should provide image and video manipulation, then that is completely out of scope for the Discord API. Dedicated events for specific message properties seem like boilerplate and more confusing than helpful. You can always just use the getters on the events to access any part you need. To do image or video manipulation, I would recommend to look for dedicated libraries just for that purpose. It does not make sense for a library that implements the Discord API to provide these features as part of its core features. The library is built for one purpose, and that's exclusively the API.
You can send up to 10 embeds in one message with You can modify an embed by using the embed builder: MessageEmbed newEmbed = new EmbedBuilder(message.getEmbeds().getFirst()) // copy existing embed into the builder
.setImage(myNewImage) // set a new image
.build(); // build the updated embed
// Then just edit the message with that new embed
message.editMessageEmbeds(newEmbed).queue(); |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
General Troubleshooting
Feature Request
Hi there,
I’m one of the users of this library and wanted to provide some feedback and suggestions for improvement. I’ve encountered several issues that I believe could be addressed to make the library more robust and user-friendly. Here are my main points:
1 Better Exception Handling One of the biggest problems I’ve faced is the lack of proper exception handling. I lost an entire week just because this library doesn’t handle NullPointerExceptions. There needs to be an exception for everything. For example:
GuildNotFoundExceptionPlayerNotFoundException(for when the player isn’t online or available)General exception handling for all potential edge cases
Right now, I have to manually check for a thousand cases, but it should be built-in for every possible event or action in the library. This would make development much smoother and would save a lot of debugging time.
2 Persistence Layer: There needs to be a built-in way to save data persistently. For example, if someone wants to track messages (like which user sent which message or who deleted which message), this data should be saved somewhere. Right now, I had to spend an entire week building a custom persistence system just to handle this, which feels like a huge oversight. Certain functions should be revisited to ensure they support persistent storage.
3 Message Deletion Issue: This is another annoying problem. In the current state, there is no way to retrieve the message that was deleted in onMessageDelete, nor the user who deleted it. This is a huge limitation, and it should be addressed. Losing important data like this is a serious issue, and I had to spend an unnecessary amount of time building workarounds just to fetch this basic information.
4 Documentation: The documentation is another major issue. There are methods listed in the docs that don’t explain what they do, which makes it really difficult to work with the library. It’s poorly managed, and this lack of clarity causes a lot of frustration. The documentation needs to be updated to include proper descriptions of all methods and their expected behaviors.
5 Handling of Media (Images, Videos, etc.): There’s no clear way to handle media like images or videos in this library. For example, an onGuildMessageVideoSent event would be useful. I should be able to work with videos, images, and other media types in a more structured way. Currently, this is missing and limits the functionality of the library for users who need to deal with such media.
6 Embedded Messages: The embedded message functionality is extremely limited. Right now, I can only send one embedded message per operation, and that’s not enough. There should be a way to send multiple embedded messages or have more flexibility in modifying embedded messages. For example, the ability to modify an image in an embed or adjust its content after sending it. This would drastically improve the user experience and make the library more versatile.
I’m well aware that my time spent writing this will probably be “wasted” because I doubt any of these suggestions will be implemented. But at least I’m trying to offer some constructive feedback on how the library can be improved. I hope you can take this into consideration.
Thanks for reading.
Example Use-Case
Beta Was this translation helpful? Give feedback.
All reactions