Skip to content

add setting and getting config in json format - #540

Merged
danthe1st merged 7 commits into
Java-Discord:mainfrom
ayyhimself:ayys-json-config
Feb 21, 2026
Merged

add setting and getting config in json format#540
danthe1st merged 7 commits into
Java-Discord:mainfrom
ayyhimself:ayys-json-config

Conversation

@ayyhimself

Copy link
Copy Markdown
Contributor

changes
/config get displays the object in json format
/config set displays the object in json format and accepts json format
removed old way of displaying objects
gson registered as a bean
very amazing pr

@ayyhimself
ayyhimself requested a review from a team as a code ownerFebruary 15, 2026 20:33

@danthe1stdanthe1st left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I have yet to test this but here's my initial review.

Comment threadsrc/main/java/net/discordjug/javabot/data/config/GuildConfig.java Outdated
Comment threadsrc/main/java/net/discordjug/javabot/data/config/GuildConfig.java Outdated
Comment threadsrc/main/java/net/discordjug/javabot/data/config/ReflectionUtils.java Outdated
Comment threadsrc/main/java/net/discordjug/javabot/data/config/ReflectionUtils.java Outdated

@danthe1stdanthe1st left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The PR looks mostly good but I noticed some issues while testing.

Comment threadsrc/main/java/net/discordjug/javabot/data/config/ReflectionUtils.java Outdated
Comment threadsrc/main/java/net/discordjug/javabot/data/config/ReflectionUtils.java Outdated
Comment threadsrc/main/java/net/discordjug/javabot/util/GsonUtils.java Outdated

@danthe1stdanthe1st left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The changes look good to me and testing (including with native-image) seems like this mostly works.

However, I noticed one small regression due to how you removed the property parsers: When I try to set a string, it requires a double quotes around it. This breaks things like /config set property:moderationConfig.banMessageText value:Hello 123. I added a suggestion of how that could probably be fixed but that doesn't mean you have to do it that way.

Comment threadsrc/main/java/net/discordjug/javabot/data/config/ReflectionUtils.java Outdated

@danthe1stdanthe1st left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me.

@danthe1st
danthe1st merged commit d21836d into Java-Discord:mainFeb 21, 2026
2 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@ayyhimself@danthe1st