JDA
JDA copied to clipboard
Add support for guild welcome screens
Pull Request Etiquette
- [x] I have checked the PRs for upcoming features/bug fixes.
- [x] I have read the contributing guidelines.
Changes
- [ ] Internal code
- [x] Library interface (affecting end-user code)
- [ ] Documentation
- [ ] Other: _____
Closes Issue: #1987
Description
this PR adds support for Guild welcome screens. this currently doesn't support modifying the welcome screen as I'm still figuring out a good design.
We should probably include creation/mutation of GuildWelcomeScreens in this PR instead of providing only read-only access.
We can likely use a simple builder system like we do with EntityBuilder to build it up.
Something else that I forgot to mention is that GuildWelcomeScreen
should be inside Guild
as Guild.WelcomeScreen
.
This follows the pattern established by other constructs that make up the Guild
itself.
Something else that I forgot to mention is that
GuildWelcomeScreen
should be insideGuild
asGuild.WelcomeScreen
. This follows the pattern established by other constructs that make up theGuild
itself.
it's intentionally in its own file because it has an inner Channel
class, so I didn't want it to look like this: Guild.WelcomeScreen.Channel
I don't personally see a problem with Guild.WelconeScreen.Channel
.
The Guild.X
classes represent constructs which are partials of a Guild's metadata. That metadata could be represented as Guild#getWelcomeScreenChannels
, Guild#getWelcomeScreenDescription
. We separate them only so that things logically make sense.
In contrast, something like GuildVoiceState
or TextChannel
are entities unto themselves. They are not metadata for the Guild
.
Hey any updates on this one?
Hey any updates on this one?
not right now, no. I won't have time for the next 2-3 weeks, so if someone wants to tackle this earlier, let me know.
Yeah choosing a good design for modifying the welcome screen seems tricky. One possible design could be to have a welcome screen manager, with methods such as SortedSet<GuildWelcomeScreen.Channel> getWelcomeChannels()
to see the order of the welcome screen channels while updating them, and methods such as void putChannelBeforeIndex(int index, GuildWelcomeScreen.Channel channel)
and void putChannelAfterIndex(int index, GuildWelcomeScreen.Channel channel)
to emulate the drag and drop ordering that people are used to in the client. And of course, more conventional methods for replacing a certain channel, removing a certain channel, etc.
Closing due to inactivity. If anyone wants to continue this based on the current master branch, feel free to open a new PR.