Skip to content

Conversation

MrMythicalYT
Copy link
Contributor

@MrMythicalYT MrMythicalYT commented Oct 31, 2022

Please describe the changes this PR makes and why it should be merged:
This PR adds a disableInvites method to Guild as a helper to disable/pause invites
Status and versioning classification:

  • 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 31, 2022

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

Name Status Preview Updated
discord-js ❌ Failed (Inspect) Dec 2, 2022 at 1:22PM (UTC)
discord-js-guide ✅ Ready (Inspect) Visit Preview Dec 2, 2022 at 1:22PM (UTC)

@Jiralite
Copy link
Member

Not sure I agree with this. Managers possess the relevant API methods. Altering a guild's features should not be on this manager.

@codecov
Copy link

codecov bot commented Oct 31, 2022

Codecov Report

Merging #8801 (adf2356) into main (8f552a0) will increase coverage by 26.85%.
The diff coverage is n/a.

❗ Current head adf2356 differs from pull request most recent head 2fda744. Consider uploading reports for the commit 2fda744 to get more accurate results

@@             Coverage Diff             @@
##             main    #8801       +/-   ##
===========================================
+ Coverage   58.75%   85.61%   +26.85%     
===========================================
  Files          11       96       +85     
  Lines        1593     9459     +7866     
  Branches       90     1134     +1044     
===========================================
+ Hits          936     8098     +7162     
- Misses        656     1319      +663     
- Partials        1       42       +41     
Flag Coverage Δ
brokers 65.24% <ø> (?)
builders 98.65% <ø> (?)
collection 100.00% <ø> (?)
proxy 81.53% <ø> (?)
rest 91.97% <ø> (?)
util 100.00% <ø> (?)
utilities 100.00% <ø> (?)
voice 63.70% <ø> (?)
ws 59.83% <ø> (+1.08%) ⬆️

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

Impacted Files Coverage Δ
...trategies/context/SimpleContextFetchingStrategy.ts 71.42% <0.00%> (-12.79%) ⬇️
packages/ws/src/utils/constants.ts 83.87% <0.00%> (-1.85%) ⬇️
packages/ws/src/utils/IdentifyThrottler.ts 100.00% <0.00%> (ø)
packages/ws/src/strategies/sharding/worker.ts 0.00% <0.00%> (ø)
...src/strategies/context/IContextFetchingStrategy.ts 100.00% <0.00%> (ø)
packages/builders/src/components/ActionRow.ts 100.00% <0.00%> (ø)
packages/voice/src/receive/SSRCMap.ts 86.20% <0.00%> (ø)
...ilders/src/components/selectMenu/RoleSelectMenu.ts 90.32% <0.00%> (ø)
...c/interactions/slashCommands/options/attachment.ts 100.00% <0.00%> (ø)
packages/util/src/types.ts 100.00% <0.00%> (ø)
... and 84 more

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

@monbrey
Copy link
Member

monbrey commented Oct 31, 2022

Agree with Jira, helper methods conventionally belong on structures, not managers. If this were to exist somewhere, a helper method to modify a GuildFeature would belong on the Guild class, e.g. Guild#disableInvites()

@MrMythicalYT MrMythicalYT changed the title feat(GuildInviteManager): add setDisabled method feat(Guild): add setDisabled method Nov 1, 2022
@MrMythicalYT MrMythicalYT changed the title feat(Guild): add setDisabled method feat(Guild): add pauseInvites method Nov 1, 2022
@MrMythicalYT MrMythicalYT changed the title feat(Guild): add pauseInvites method feat(Guild): add disableInvites method Nov 1, 2022
@Jiralite Jiralite added this to the discord.js v14.7 milestone Nov 1, 2022
@MrMythicalYT MrMythicalYT requested review from Jiralite and removed request for SpaceEEC, iCrawl, kyranet and vladfrangu November 2, 2022 13:31
@jaw0r3k
Copy link
Contributor

jaw0r3k commented Nov 2, 2022

Doesn't pauseInvites sound better
also it more intuitive as ppl will search like that

@Jiralite Jiralite requested review from kyranet and vladfrangu and removed request for Jiralite November 2, 2022 15:22
@Jiralite Jiralite requested review from SpaceEEC and iCrawl November 2, 2022 15:22
@MrMythicalYT
Copy link
Contributor Author

Doesn't pauseInvites sound better also it more intuitive as ppl will search like that

Since the feature is called Invites Disabled, it makes more sense to call it disableInvites.

@jaw0r3k
Copy link
Contributor

jaw0r3k commented Nov 3, 2022

Doesn't pauseInvites sound better also it more intuitive as ppl will search like that

Since the feature is called Invites Disabled, it makes more sense to call it disableInvites.

Discord faq named it pausing
https://support.discord.com/hc/en-us/articles/8458903738647-Pause-Invites-FAQ

Copy link
Member

@kyranet kyranet left a comment

Choose a reason for hiding this comment

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

I don't mind if the method ends up being named disableInvites or pauseInvites (although the latter has the issue about being a bit weird to "resume" using a "pause" method).

Regardless of that, we use API names rather than client names, that's why we use "guild" rather than "server", for example.

@jaw0r3k
Copy link
Contributor

jaw0r3k commented Nov 20, 2022

I don't mind if the method ends up being named disableInvites or pauseInvites (although the latter has the issue about being a bit weird to "resume" using a "pause" method).

Regardless of that, we use API names rather than client names, that's why we use "guild" rather than "server", for example.

a bit like that
but when user will search it probably will be pause not disable invites
so its better as more intuitive

@martinbndr
Copy link

martinbndr commented Jul 1, 2024

This needs to be updated. Disabeling invites is not done via the guild features anymore. Instead you need to provide an invites_disabled_until field in the guild edit payload with an end. Since invites could not be paused infinite.
Setting it to none would re enable it.

@Jiralite
Copy link
Member

Jiralite commented Jul 1, 2024

This pull request was made 2 years ago. You should open a new issue instead of leaving a comment here.

Anyway, Discord has not documented this, so nothing is happening. discord/discord-api-docs#6396

@discordjs discordjs locked as resolved and limited conversation to collaborators Jul 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

9 participants