Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for forum channels #2184

Merged
merged 79 commits into from
Sep 20, 2022
Merged
Changes from 1 commit
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
b9065ee
Add initial support for forum channels
MinnDevelopment Jul 19, 2022
5644266
Fix some copy-paste issues
MinnDevelopment Jul 19, 2022
0cabd2d
Update union type list
MinnDevelopment Jul 19, 2022
a97bc91
Add ForumChannel#createForumPost
MinnDevelopment Jul 19, 2022
d3d3719
Implement ForumChannelManagerImpl
MinnDevelopment Jul 20, 2022
eb78683
Merge remote-tracking branch 'origin/master' into feature/forums
MinnDevelopment Jul 20, 2022
8765433
Improve checks in ChannelActionImpl
MinnDevelopment Jul 20, 2022
fd4d312
Remove tags
MinnDevelopment Jul 20, 2022
45ae0ca
Add throws docs for other overload
MinnDevelopment Jul 20, 2022
581f56f
Add docs for permission checks
MinnDevelopment Jul 20, 2022
48ba485
Add new message count logic
MinnDevelopment Jul 26, 2022
26d4428
Fix typo
MinnDevelopment Jul 26, 2022
9768352
Add forums to Guild#getChannels
MinnDevelopment Jul 31, 2022
9418b61
Add Category#getForumChannels
MinnDevelopment Jul 31, 2022
9aaf5f7
Clear forum channel cache on invalidate
MinnDevelopment Jul 31, 2022
a30040e
Reduce code duplication in createXChannel
MinnDevelopment Jul 31, 2022
3919196
Improve some documentation
MinnDevelopment Jul 31, 2022
628e2f7
Add Category#createNewsChannel
MinnDevelopment Jul 31, 2022
b4739f6
Add missing docs for IThreadContainer
MinnDevelopment Jul 31, 2022
cb4ed95
Improve handling of thread parents
MinnDevelopment Aug 8, 2022
0f37bff
Update docs for ThreadChannel
MinnDevelopment Aug 8, 2022
bc34c48
Update more docs of thread channel
MinnDevelopment Aug 8, 2022
3d2f7e9
Make getForumChannelCache return the cache instead of null
MinnDevelopment Aug 8, 2022
e25b4e2
Merge remote-tracking branch 'origin/master' into feature/forums
MinnDevelopment Aug 16, 2022
a689e3e
Add ForumPostAction
MinnDevelopment Aug 16, 2022
32cfbd6
Update some docs
MinnDevelopment Aug 16, 2022
11517ad
Update src/main/java/net/dv8tion/jda/api/entities/Guild.java
MinnDevelopment Aug 16, 2022
8770569
Fix javadoc errors
MinnDevelopment Aug 16, 2022
346c3a4
Add missing break
MinnDevelopment Aug 30, 2022
6b28ff9
Add another missing break
MinnDevelopment Aug 30, 2022
d7ebf59
Add missing docs
MinnDevelopment Aug 30, 2022
3940806
Update docs for archives and add some more missing docs
MinnDevelopment Aug 30, 2022
6e4d5f1
Add handling for forum topic length
MinnDevelopment Aug 30, 2022
a336739
Add basic support for applying tags
MinnDevelopment Aug 30, 2022
bed9213
Add check for max tags
MinnDevelopment Aug 30, 2022
f8c44fb
Merge remote-tracking branch 'origin/master' into feature/forums
MinnDevelopment Aug 30, 2022
c86264e
Add support for applied tags on threads
MinnDevelopment Aug 30, 2022
f3fbf18
Add handling for tag updates
MinnDevelopment Aug 30, 2022
9160ed7
Add cache flag for forum tags
MinnDevelopment Aug 31, 2022
a1d3c46
Handle default thread slowmode
MinnDevelopment Sep 1, 2022
dfccd62
Handle channel flags for forums
MinnDevelopment Sep 1, 2022
ae85f75
Handle thread flags
MinnDevelopment Sep 1, 2022
d5a4961
Merge remote-tracking branch 'origin/master' into feature/forums
MinnDevelopment Sep 14, 2022
191acca
Implement tag ordering by position
MinnDevelopment Sep 14, 2022
bca3972
Implement tag emoji and setting available tags on managers
MinnDevelopment Sep 14, 2022
2082c83
Add support to manage available tags
MinnDevelopment Sep 14, 2022
0e1906a
Add webhook support to forums
MinnDevelopment Sep 14, 2022
64162cc
Add convenience getters and support modifying tags
MinnDevelopment Sep 14, 2022
f7ace19
Support changing channel flags
MinnDevelopment Sep 14, 2022
22fbb46
Add support for default reactions
MinnDevelopment Sep 15, 2022
47ac2c1
Add missing docs
MinnDevelopment Sep 15, 2022
935116c
Fix some docs
MinnDevelopment Sep 15, 2022
2f6b4e4
Remove todo and update exception message
MinnDevelopment Sep 15, 2022
854a759
Add missing docs to BaseForumTag
MinnDevelopment Sep 15, 2022
f324cb1
Fix annotation
MinnDevelopment Sep 15, 2022
30edf96
Use FluentRestAction interface
MinnDevelopment Sep 15, 2022
4ea02aa
Make ChannelUpdateAppliedTagsEvent cache independent
MinnDevelopment Sep 15, 2022
35a60c7
Update ChannelManager#setTopic
MinnDevelopment Sep 15, 2022
a3a4ddd
Update exception message for setAppliedTags
MinnDevelopment Sep 15, 2022
31ecfa0
Move checkTypes into Checks class
MinnDevelopment Sep 15, 2022
be4b40c
Rename create thread routes
MinnDevelopment Sep 15, 2022
c2f104b
Update src/main/java/net/dv8tion/jda/api/events/channel/update/Channe…
MinnDevelopment Sep 15, 2022
1f9c577
Update src/main/java/net/dv8tion/jda/internal/handle/MessageDeleteHan…
MinnDevelopment Sep 15, 2022
9c777e4
Add forum tag events
MinnDevelopment Sep 16, 2022
7d09a14
Fix constructors
MinnDevelopment Sep 16, 2022
f8c3cbc
Introduce ISlowmodeChannel attribute interface
MinnDevelopment Sep 17, 2022
af69976
Add varargs version of setAppliedTags
MinnDevelopment Sep 17, 2022
81adfa9
Add FluentAuditableRestAction
MinnDevelopment Sep 17, 2022
bab2947
Rename isRequireTag to isTagRequired
MinnDevelopment Sep 17, 2022
e02dea1
Add more accessors for forum tags
MinnDevelopment Sep 17, 2022
50f23a0
Add event docs
MinnDevelopment Sep 17, 2022
8a90838
Use constants more
MinnDevelopment Sep 17, 2022
0d0fb2b
Update the slowmode supported types and remove outdated todo comment
MinnDevelopment Sep 17, 2022
a22fb78
Add missing setters to ChannelAction
MinnDevelopment Sep 17, 2022
fce8eaa
Add docs for ISlowmodeChannelManager
MinnDevelopment Sep 19, 2022
9951047
Mention CacheFlag in getAvailableTagCache
MinnDevelopment Sep 19, 2022
f7c97f9
Add type checks to ChannelAction
MinnDevelopment Sep 19, 2022
0aa796b
Add default sort oder
MinnDevelopment Sep 19, 2022
051ee54
Missed event
MinnDevelopment Sep 19, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,98 @@ default ChannelAction<ForumChannel> createCopy()
return createCopy(getGuild());
}

/**
* The available {@link ForumTag ForumTags} for this forum channel.
* <br>Tags are sorted by their {@link ForumTag#getPosition() position} ascending.
*
* @return {@link SortedSnowflakeCacheView} of {@link ForumTag}
*/
@Nonnull
SortedSnowflakeCacheView<ForumTag> getAvailableTagCache();
MinnDevelopment marked this conversation as resolved.
Show resolved Hide resolved

/**
* The available {@link ForumTag ForumTags} for this forum channel.
* <br>Tags are sorted by their {@link ForumTag#getPosition() position} ascending.
*
* <p>This is a shortcut for {@link #getAvailableTagCache() getAvailableTagCache().asList()}.
* This method will copy the underlying cache into the list, running in {@code O(n)} time.
*
* <p>This requires {@link net.dv8tion.jda.api.utils.cache.CacheFlag#FORUM_TAGS CacheFlag.FORUM_TAGS} to be enabled.
*
* @return Immutable {@link List} of {@link ForumTag}
*/
@Nonnull
default List<ForumTag> getAvailableTags()
{
return getAvailableTagCache().asList();
}

/**
* The available {@link ForumTag ForumTags} for this forum channel.
* <br>Tags are sorted by their {@link ForumTag#getPosition() position} ascending.
*
* <p>This is a shortcut for {@link #getAvailableTagCache() getAvailableTagCache().getElementsByName(name, ignoreCase)}.
* This method will copy the underlying cache into the list, running in {@code O(n)} time.
*
* <p>This requires {@link net.dv8tion.jda.api.utils.cache.CacheFlag#FORUM_TAGS CacheFlag.FORUM_TAGS} to be enabled.
*
* @param name
* The name of the tag
* @param ignoreCase
* Whether to use {@link String#equalsIgnoreCase(String)}
*
* @throws IllegalArgumentException
* If the name is {@code null}
*
* @return Immutable {@link List} of {@link ForumTag} with the given name
*/
@Nonnull
default List<ForumTag> getAvailableTagsByName(@Nonnull String name, boolean ignoreCase)
{
return getAvailableTagCache().getElementsByName(name, ignoreCase);
}

/**
* Retrieves the tag for the provided id.
*
* <p>This requires {@link net.dv8tion.jda.api.utils.cache.CacheFlag#FORUM_TAGS CacheFlag.FORUM_TAGS} to be enabled.
*
* @param id
* The tag id
*
* @return The tag for the provided id, or {@code null} if no tag with that id exists
*
* @see net.dv8tion.jda.api.entities.channel.forums.ForumTagSnowflake#fromId(long)
*/
@Nullable
default ForumTag getAvailableTagById(long id)
{
return getAvailableTagCache().getElementById(id);
}

/**
* Retrieves the tag for the provided id.
*
* <p>This requires {@link net.dv8tion.jda.api.utils.cache.CacheFlag#FORUM_TAGS CacheFlag.FORUM_TAGS} to be enabled.
*
* @param id
* The tag id
*
* @throws IllegalArgumentException
* If the provided id is null
* @throws NumberFormatException
* If the provided id is not a valid snowflake
*
* @return The tag for the provided id, or {@code null} if no tag with that id exists
*
* @see net.dv8tion.jda.api.entities.channel.forums.ForumTagSnowflake#fromId(String)
*/
@Nullable
default ForumTag getAvailableTagById(@Nonnull String id)
{
return getAvailableTagCache().getElementById(id);
}

/**
* The topic set for this channel, this is referred to as <em>Guidelines</em> in the official Discord client.
* <br>If no topic has been set, this returns null.
Expand Down