discord-jda / JDA

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

Add Android Compatibility by removing UNICODE_CHARACTER_CLASS flag which DOES NOT run on Android #2682

Closed sss-ryun closed 3 months ago

sss-ryun commented 3 months ago

Pull Request Etiquette

Changes

Closes Issue: NaN

Description

Android throws Caused by: java.lang.IllegalArgumentException: UNICODE_CHARACTER_CLASS flag not supported if you use JDA in Android. This prevents it from being used inside Android.

Why? Well, I want to run my Discord Bot in Android because it's power efficient and has its own UPS. I have succeeded in doing as such

Andre601 commented 3 months ago

Is there a general benefit for the majority of users?

Because if it only benefits you can you just make and use your fork that has these changes...

sss-ryun commented 3 months ago

Is there a general benefit for the majority of users?

Because if it only benefits you can you just make and use your fork that has these changes...

Yes. The majority of bot developers run small bots according to Discord, so it would be beneficial to those who want to run their bot without keeping their computers on all the time which may not be possible, and the battery of Android Phones act as UPS in case of power lost. Overall, I think this opens up a new development path for Discord Bot developers

freya022 commented 3 months ago

Android always uses unicode character classes, however, you cannot remove that flag from these patterns, as it would make any non-latin character be rejected, which would otherwise be valid for Discord.

And I think I'd rather have non-latin users be able to make Discord bots rather than try to please Google that chose not to support (or even just ignore) such flag

Please use your own fork if you want to use JDA with such modifications

sss-ryun commented 3 months ago

I understand. I'll try to find a middle ground when I'm not as busy. I don't want to maintain a fork