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(ThreadChannel): add a helper for pin and unpin #8786

Merged
merged 12 commits into from Nov 19, 2022

Conversation

Idris1401
Copy link
Contributor

Please describe the changes this PR makes and why it should be merged:

With the help of @monbrey and @almeidx.

Status and versioning classification:

Please move lines that apply to you out of the comment:

  • Code changes have been tested against the Discord API, or there are no code changes
  • I know how to update typings and have done so, or typings don't need updating
  • This PR changes the library's interface (methods or parameters added)

@vercel
Copy link

vercel bot commented Oct 25, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Ignored Deployments
Name Status Preview Updated
discord-js ⬜️ Ignored (Inspect) Nov 19, 2022 at 8:47PM (UTC)
discord-js-guide ⬜️ Ignored (Inspect) Nov 19, 2022 at 8:47PM (UTC)

packages/discord.js/src/structures/ThreadChannel.js Outdated Show resolved Hide resolved
packages/discord.js/src/structures/ThreadChannel.js Outdated Show resolved Hide resolved
packages/discord.js/src/structures/ThreadChannel.js Outdated Show resolved Hide resolved
packages/discord.js/src/structures/ThreadChannel.js Outdated Show resolved Hide resolved
@Jiralite Jiralite added this to the discord.js v14.7 milestone Oct 25, 2022
Idris1401 and others added 5 commits October 26, 2022 00:20
Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
Co-authored-by: Almeida <almeidx@pm.me>
Co-authored-by: Almeida <almeidx@pm.me>
@codecov
Copy link

codecov bot commented Oct 25, 2022

Codecov Report

Merging #8786 (fdcb99f) into main (6e348ff) will increase coverage by 0.38%.
The diff coverage is 87.62%.

❗ Current head fdcb99f differs from pull request most recent head 7e3fc47. Consider uploading reports for the commit 7e3fc47 to get more accurate results

@@            Coverage Diff             @@
##             main    #8786      +/-   ##
==========================================
+ Coverage   85.22%   85.61%   +0.38%     
==========================================
  Files          77       96      +19     
  Lines        6715     9459    +2744     
  Branches      877     1134     +257     
==========================================
+ Hits         5723     8098    +2375     
- Misses        953     1319     +366     
- Partials       39       42       +3     
Flag Coverage Δ
brokers 65.24% <ø> (?)
builders 98.65% <87.87%> (-1.35%) ⬇️
collection 100.00% <ø> (ø)
proxy 81.53% <ø> (ø)
rest 91.97% <82.35%> (?)
util 100.00% <ø> (ø)
utilities 100.00% <ø> (ø)
voice 63.70% <ø> (ø)
ws 59.83% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...ackages/rest/src/lib/handlers/SequentialHandler.ts 86.07% <50.00%> (ø)
packages/builders/src/components/Components.ts 87.87% <60.00%> (-12.13%) ⬇️
...ers/src/components/selectMenu/ChannelSelectMenu.ts 63.49% <63.49%> (ø)
...src/components/selectMenu/MentionableSelectMenu.ts 90.32% <90.32%> (ø)
...ilders/src/components/selectMenu/RoleSelectMenu.ts 90.32% <90.32%> (ø)
...ilders/src/components/selectMenu/UserSelectMenu.ts 90.32% <90.32%> (ø)
...ilders/src/components/selectMenu/BaseSelectMenu.ts 92.18% <92.18%> (ø)
packages/rest/src/lib/utils/utils.ts 97.33% <92.30%> (ø)
packages/builders/src/components/ActionRow.ts 100.00% <100.00%> (ø)
packages/builders/src/components/Assertions.ts 100.00% <100.00%> (ø)
... and 17 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@almeidx almeidx left a comment

Choose a reason for hiding this comment

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

Actually, probably shouldn't be mutating the flags bit field like that (in case of failure, etc)
Something like this should do the trick

aiko-chan-ai added a commit to aiko-chan-ai/discord.js-selfbot-v13 that referenced this pull request Oct 26, 2022
Co-authored-by: Aura Román <kyradiscord@gmail.com>
@Idris1401
Copy link
Contributor Author

@kyranet do I edit types for <ThreadChannel>.setAppliedTags()?

@Idris1401
Copy link
Contributor Author

@kyranet do I edit types for <ThreadChannel>.setAppliedTags()?

ah you said except that one mb

@kyranet
Copy link
Member

kyranet commented Oct 27, 2022

I meant that all the other methods have the correct return type based on this.edit()'s, but that one was somehow the exception, not that it should, it looks like an oversight from an earlier PR.

I personally don't mind changing it, but it's also out of this PR's scope, feel free to create a new one. This PR is fine as-is.

@Idris1401
Copy link
Contributor Author

should I add a note saying that only forum threads can be pinned?
as .setAppliedTags() has

@kyranet
Copy link
Member

kyranet commented Oct 27, 2022

Good catch, please do so @Idris1401.

@Idris1401
Copy link
Contributor Author

also isn't this why .setAppliedTags() returns Promise<ThreadChannel<true>> and not Promise<AnyThreadChannel> ?

@kodiakhq kodiakhq bot merged commit e74aa7f into discordjs:main Nov 19, 2022
@Idris1401 Idris1401 deleted the feats branch November 19, 2022 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

8 participants