pycord icon indicating copy to clipboard operation
pycord copied to clipboard

feat: :sparkles: Add missing feature flags to `Guild.edit`

Open Paillat-dev opened this issue 1 year ago • 7 comments

Summary

https://discord.com/developers/docs/resources/guild#guild-object-guild-features and also https://discord.com/channels/881207955029110855/881224361015672863/1318631076209491968

This also fixes an issue where one could not edit the state of both the COMMUNITY and INVITES_DISABLED flags at once.

Information

  • [ ] This PR fixes an issue.
  • [x] This PR adds something new (e.g. new method or parameters).
  • [ ] This PR is a breaking change (e.g. methods or parameters removed/renamed).
  • [ ] This PR is not a code change (e.g. documentation, README, typehinting, examples, ...).

Checklist

  • [x] I have searched the open pull requests for duplicates.
  • [x] If code changes were made then they have been tested.
    • [x] I have updated the documentation to reflect the changes.
  • [ ] If type: ignore comments were used, a comment is also left explaining why.
  • [x] I have updated the changelog to include these changes.

Paillat-dev avatar Dec 17 '24 20:12 Paillat-dev

I thought we stopped maintaining guild.features.

JustaSqu1d avatar Dec 17 '24 23:12 JustaSqu1d

Oh. I didn't know that. Lala just told me I could do it But I'm interested in knowing why this wouldn't be supported by pycord anymore - it's part of the api after all.

Paillat-dev avatar Dec 18 '24 13:12 Paillat-dev

Oh. I didn't know that. Lala just told me I could do it But I'm interested in knowing why this wouldn't be supported by pycord anymore - it's part of the api after all.

We'd be adding a new feature flag like every week. Most feature flags aren't really even used.

JustaSqu1d avatar Dec 18 '24 15:12 JustaSqu1d

This pr focuses on adding toggle in Guild.edit for feature flags that can be edited. It does not add feature flags to the list. Maybe my pr title is misleading ?

Paillat-dev avatar Dec 18 '24 16:12 Paillat-dev

  1. I've removed the variable and added a comparison between the new list of features and the old one instead. Tested, works.

  2. I realised the new parameter for feature RAID_ALERTS_DISABLED is called raid_alerts without a verb but for INVITES_DISABLED we have disable_invites. Therefore I suggest replacing raid_alerts with disable_raid_alerts.

  3. Here, one of ACTIVITY_FEED_ENABLED_BY_USER and ACTIVITY_FEED_DISABLED_BY_USER always gets added no matter the value of enable_activity_feed. Could a user not want to remove both? I really don't know whether that's an option. Also this is the only parameter called enable. Maybe keep but add disable_activity_feed?

Dorukyum avatar Jan 02 '25 19:01 Dorukyum

activity feed is an opt-in thing, hence it has an enable flag

Lulalaby avatar Jan 02 '25 19:01 Lulalaby

  1. Ok.
  2. I can take a look and see if I can make it more consistent. - done
  3. They both toggle the same thing. Idk why there are two flags, probably discord wanted to "enable it" for all guilds without having to add a flag to each and every guild so the default when none of the two flags are present is to be enabled. Honestly idk that's just how it's implemented.

Paillat-dev avatar Jan 03 '25 10:01 Paillat-dev