-
Notifications
You must be signed in to change notification settings - Fork 417
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
feat(ForumChannels): Support Forum Channels #1452
feat(ForumChannels): Support Forum Channels #1452
Conversation
ETA? Would be epic to have this! |
No ETA |
* Makes `[options.autoArchiveDuration]` optional * Adds `[options.rateLimitPerUser]` * Adds `[options.reason]` Adds all of the above to `createThreadWithMessage` and `createThreadWithoutMessage` across all structures and the Client * Specifies that `[options.type]` wont always be optional within `createThreadWithoutMessage` * Document that `createThreadWithoutMessage` can return `NewsThreadChannel` and `PublicThreadChannel` rather than only `PrivateThreadChannel`, if the developer specifies a thread type
Working on this again. It's still a wip and I'll update the ts docs when Im finished with everything else. Yes I'm aware that some properties/functions are incorrect - I started this when forums first came out and Discord has changed a lot of stuff around since then |
Added, if you change your mind then I can remove it just as easily. Lmk if the way I've done it is okay! It'll list all archived threads too afaik. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it worth adding a getter for the channel's threads?
Added, if you change your mind then I can remove it just as easily. Lmk if the way I've done it is okay! It'll list all archived threads too afaik.
Should be fine. Thread channel data is cached when the following happens:
- Active accessible threads on connection
- Bot joins a thread
- Archived thread which wasn't cached previously becomes active
The only time a thread is removed from cache is when the thread itself gets deleted. If the bot gets removed from the thread or the thread gets archived, the thread will still be cached
Support Forum Channels (finally)
To do:
createThread
function to clientcreateThread
functions/docs to match Discords documentation (the current function is missing some properties)THREAD_UPDATE
event with newer propertiesAdditions:
ChannelFlags
(supportsPINNED
(type2
, thread channels only) &REQUIRE_TAG
(type16
, forum channels only))appliedTags
&flags
properties to the old thread channel whenever a thread gets updated. Discord gives you the ability to change both of these optionstotalMessagesSent
prop to ThreadChannel structappliedTags
prop to ThreadChannel structoptions.rateLimitPerUser
args to all functions which create threadsoptions.reason
args to all functions which create threadsoptions.autoArchiveDuration
is now optional in all functions which create threadsDeprecations:
This PR deprecates the
createThreadWithoutMessage
function in favour ofcreateThread
. Both functions use the same endpoint which expects the same payload. If you usecreateThread
on a normal channel rather than a forum channel, you can supply thetype
option to choose what type of thread you want to create. UsingcreateThread
on a forum channel will create a public thread regardless. I'm going to make this more obvious in the docs.I'm open to feedback if anyone disagrees with me and thinks we should keep both functions 🤷