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

feat/refactor(Channels): Restructure channel classes, text in stage support #1485

Merged
merged 35 commits into from
Mar 26, 2024

Conversation

bsian03
Copy link
Collaborator

@bsian03 bsian03 commented Feb 4, 2024

TODO:

  • JSDoc
  • Typings
  • toJSON methods
  • Merge ForumChannel
  • createGroupChannel proper support
  • ThreadMember guildMember remove REST note
  • Remove the console log from Channel
  • Check discord-api-docs PRs for undocumented props needing to be added

BREAKING CHANGES:

  • TextVoiceChannel removed
  • Channel#client is now hidden (renamed Channel#_client)
  • DMChannel#recipient (formerly PrivateChannel) is now recipients as a collection with a single entry (or supposed to)

Channel structure is now:

  • Channel
    • DMChannel
    • GroupChannel
    • GuildChannel
      • CategoryChannel
      • ForumChannel
      • GuildTextableChannel
        • TextChannel
          • NewsChannel
        • VoiceChannel
          • StageChannel
        • ThreadChannel
          • PrivateThreadChannel
          • PublicThreadChannel
          • NewsThreadChannel

With this change, only methods/properties relevant to the class/structure will be present. All others have been removed without deprecation

Features

  • GuildTextableChannel class - acts as a "middleman" class for common props/methods across all kinds of guild channels where you can send messages in
  • Group Channel changes:
    • Unmarked user account flag for relevant methods
    • Actual support for adding users to group channel (requires OAuth gdm.join scope)
  • Document content.nonce for messages
  • getThreadMember endpoint

Fixes

  • Docs:
    • deleteChannel return type
  • ThreadMember#guildMember is now populated (consider renaming to just member?)

Deprecations

  • PrivateChannel -> DMChannel
  • Client#privateChannelMap -> Client#dmChannelMap
  • Client#privateChannels -> Client#dmChannels

(note this is probably out of date)

@bsian03 bsian03 mentioned this pull request Feb 4, 2024
32 tasks
@bsian03 bsian03 linked an issue Feb 4, 2024 that may be closed by this pull request
lib/Client.js Show resolved Hide resolved
lib/structures/GuildChannel.js Outdated Show resolved Hide resolved
lib/structures/NewsChannel.js Show resolved Hide resolved
lib/structures/CategoryChannel.js Show resolved Hide resolved
lib/structures/Channel.js Outdated Show resolved Hide resolved
lib/structures/GuildChannel.js Outdated Show resolved Hide resolved
lib/structures/GuildTextableChannel.js Outdated Show resolved Hide resolved
lib/structures/GuildTextableChannel.js Outdated Show resolved Hide resolved
lib/structures/GuildTextableChannel.js Show resolved Hide resolved
lib/gateway/Shard.js Outdated Show resolved Hide resolved
lib/gateway/Shard.js Outdated Show resolved Hide resolved
@bsian03
Copy link
Collaborator Author

bsian03 commented Feb 6, 2024

Heck. I'll resolve these voice things for now and do a find all and replace at some point

@bsian03
Copy link
Collaborator Author

bsian03 commented Feb 23, 2024

Status update: Typings are done updating channel classes up to VoiceChannel

@bsian03
Copy link
Collaborator Author

bsian03 commented Feb 26, 2024

Typings are now in a usable state and am happy for them to be reviewed only for any corrections needing to be made. I'm still working on a couple of details (e.g. implementing) and inconsistencies so please refrain from doing reviews on them until I'm finished with it

Copy link
Collaborator Author

@bsian03 bsian03 left a comment

Choose a reason for hiding this comment

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

Typings should be finalised apart from ordering alphabetically

Copy link
Collaborator Author

@bsian03 bsian03 left a comment

Choose a reason for hiding this comment

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

Opinions for the change made in Permission/PermissionOverwrite?

@bsian03 bsian03 marked this pull request as ready for review March 26, 2024 21:05
@bsian03
Copy link
Collaborator Author

bsian03 commented Mar 26, 2024

Okay well I waited long enough for any reviews and none were made, so I'm just going to push ahead with this merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error when messages created in stage channels
3 participants