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(editChannelPositions): add support for endpoint #1328

Merged
merged 18 commits into from
Jun 7, 2022

Conversation

carloslimaborges
Copy link
Contributor

Copy link
Contributor

@eritbh eritbh left a comment

Choose a reason for hiding this comment

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

Would probably make sense to add a corresponding helper on Guild, and types for the new method(s) should be added to index.d.ts as well. The added code code looks fine to me though.

lib/Client.js Outdated Show resolved Hide resolved
@carloslimaborges
Copy link
Contributor Author

Would probably make sense to add a corresponding helper on Guild, and types for the new method(s) should be added to index.d.ts as well. The added code code looks fine to me though.

Done 😃

Copy link
Collaborator

@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.

Endpoint also accepts an audit log entry and thus should include reason when calling the method

index.d.ts Outdated Show resolved Hide resolved
lib/Client.js Outdated Show resolved Hide resolved
lib/Client.js Outdated Show resolved Hide resolved
@carloslimaborges
Copy link
Contributor Author

Endpoint also accepts an audit log entry and thus should include reason when calling the method

I will need help on this one, cause the body I send is an array. And I can't add a reason to that array to send to the RequestHandler. Changing the RequestHandler for this made me a bit uncomfortable, considering this is my first big contribution.

Copy link
Contributor Author

@carloslimaborges carloslimaborges left a comment

Choose a reason for hiding this comment

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

Please check if it is ok after the changes

@eritbh
Copy link
Contributor

eritbh commented Feb 23, 2022

the body I send is an array. And I can't add a reason to that array to send to the RequestHandler.

Maybe a little unorthodox, but manually assigning body.reason after the initial assignment should be fine. It doesn't look like the request handler does anything special other than reading that property and then deleting it, so I think this is a case where adding an extra property to an array is safe.

It might be better to restructure the request handler's request method to take an explicit argument for the X-Audit-Log header, or maybe an object argument for setting arbitrary headers, but that feels like a bigger change that would require updates to a bunch of other code at the same time. I'm not a maintainer, but my take is that sort of change should probably be a separate PR.

@carloslimaborges
Copy link
Contributor Author

the body I send is an array. And I can't add a reason to that array to send to the RequestHandler.

Maybe a little unorthodox, but manually assigning body.reason after the initial assignment should be fine. It doesn't look like the request handler does anything special other than reading that property and then deleting it, so I think this is a case where adding an extra property to an array is safe.

It might be better to restructure the request handler's request method to take an explicit argument for the X-Audit-Log header, or maybe an object argument for setting arbitrary headers, but that feels like a bigger change that would require updates to a bunch of other code at the same time. I'm not a maintainer, but my take is that sort of change should probably be a separate PR.

It did work. So I finished the change.

@carloslimaborges
Copy link
Contributor Author

Endpoint also accepts an audit log entry and thus should include reason when calling the method

I resolved this, how do I mark it as resolved at github?

bsian03
bsian03 previously requested changes Mar 8, 2022
lib/Client.js Outdated Show resolved Hide resolved
lib/Client.js Outdated Show resolved Hide resolved
lib/Client.js Outdated Show resolved Hide resolved
lib/structures/Guild.js Outdated Show resolved Hide resolved
Carlos Lima and others added 2 commits March 8, 2022 23:22
Co-authored-by: bsian03 <[email protected]>
Co-authored-by: bsian03 <[email protected]>
@carloslimaborges carloslimaborges requested a review from bsian03 March 9, 2022 02:24
lib/Client.js Outdated Show resolved Hide resolved
@carloslimaborges
Copy link
Contributor Author

Is there any change request I haven't dealt with yet? I get a little bit confused by the github interface, sorry

@abalabahaha abalabahaha changed the title Allows multiple channel position changes in a single request feat(editChannelPositions): add support for endpoint Jun 7, 2022
@abalabahaha abalabahaha merged commit 99b1376 into abalabahaha:dev Jun 7, 2022
DonovanDMC added a commit to DonovanArchive/ErisPRUpdateBot that referenced this pull request Jun 8, 2022
Brainicism added a commit to Brainicism/eris that referenced this pull request Feb 13, 2023
* fix(voice): re-add receive listener on connect (abalabahaha#1332)

* fix(getAllUsers): request presences if intent is enabled (abalabahaha#1378)

* chore(Base): document props, static methods (abalabahaha#1380)

* fix(Guild#editCommandPermissions): fix alias typo (abalabahaha#1350)

* fix(getGuildAuditLog): cache users & threads earlier (abalabahaha#1367)

* fix(messageUpdate): fix oldMessage#mentions type (abalabahaha#1377)

* fix(joinVoiceChannel): skip permission check if Member uncached (abalabahaha#1383)

Co-authored-by: Donovan Daniels <[email protected]>

* fix(ShardManager): refactor concurrency check, add option (abalabahaha#1382)

* fix(createRole): split options into separate overloads (abalabahaha#1376)

* feat(getGuildBans): support pagination (abalabahaha#1363)

Co-authored-by: abalabahaha <[email protected]>

* feat(editChannelPositions): add support for endpoint (abalabahaha#1328)

Co-authored-by: bsian03 <[email protected]>
Co-authored-by: abalabahaha <[email protected]>

* fix(editChannel): fix `videoQualityMode` & add `permissionOverwrites` (abalabahaha#1319)

* feat(connect): add token check (abalabahaha#1283)

* feat(Client): allow custom numbers in intents option (abalabahaha#1388)

Co-authored-by: Donovan Daniels <[email protected]>
Co-authored-by: abalabahaha <[email protected]>

* feat(interactions): Add support for appPermissions (abalabahaha#1394)

* fix(Client): remove optional chaining from 05a932a

* 0.17.1

* chore: bump dev version to 0.17.2-dev

* feat(Member): Add dynamicAvatarURL (abalabahaha#1411)

* feat(permissions): Slash Permissions v2 (PR 1372)

* Attachment type (PR 1358)

* Remove all user account features (PR 1338)

* refactor(interactions): Interactions Refactor (PR 1309)

* feat(interactions): Support Modals (PR 1404)

* Use process warnings for deprecations (PR 1276)

* Guild Scheduled Events (PR 1275)

* Follow http/https redirects when playing song (PR 494)

* Return void on 204 (PR 1021)

* Allow configuring RequestHandler to use HTTP instead of HTTPS (PR 1193)

* Standardized parsing errors (PR 1227)

* feat(gateway): Use New Resume URL (PR 1410)

* refactor: remove StoreChannels (PR 1405)

* feat(bans): Seconds Support (PR 1397)

* feat(AutoModeration): Support Auto Moderation (PR 1390)

* feat(options): Gateway Options (PR 1384)

* refactor: Overall Consistency Fixes & Minor Feature Additions (PR 1379)

* fix(CommandClient): await permission checks (PR 1414)

* feat: API v10 (PR 1371)

* chore: rebrand to Project Dysnomia

* lint

* fix: use ./* for exports

* chore: rename forgotten references to Eris (#2)

For the time being, until I figure out what to do with references to Eris' website, appropriate links in code/Discord's API docs have been linked.

* chore: remove deprecated/dead code (#3)

* feat: entity select types (#4)

* chore(examples/intent): fix import typo (#6)

* chore: update example in README.md (#7)

* feat: modern file uploading (#5)

* fixup(Client): oops :( make _processAttachments return the expected structure (#8)

Also do not pass empty file arrays (triggers data being sent over as multipart data)

* feat(automoderation): support new trigger metadata (#9)

* support new trigger metadata types

* update trigger type constants

* deprecate camel-cased trigger metadata, use raw metadata instead

* feat(Constants): add ACTIVE_DEVELOPER user flag (#10)

* feat: forum support (#1)

I believe this should be enough to ensure full forum support. Although, some things might've been missed out by accident.

* Attachment#proxyUrl -> Attachment#proxyURL (#11)

* fix(Client): do not send the file buffer twice (#13)

* feat(Guild): automatically populate events on GUILD_CREATE (#12)

* feat(ForumChannel): `default_forum_layout` (#14)

* chore: update dev dependencies and lint (#15)

* chore: remove editGuildVanity (abalabahaha#18)

* Removed editGuildVanity

The vanity endpoint was disabled for bots

```
{
    "message": "Bots cannot use this endpoint",
    "code": 20001
}
```

* remove Guild#editVanity

* update TSDs appropriately

Co-authored-by: Lars_und_so <[email protected]>

* feat(ApplicationCommand): support NSFW commands (#16)

* docs: document audit log after parameter (abalabahaha#20)

ref: discord/discord-api-docs@38f01b0

* fix(Constants): wrong ACTIVE_DEVELOPER bit (╯°□°)╯︵ ┻━┻ (abalabahaha#23)

* feat: add new message types (abalabahaha#22)

* feat: add new message types

currently won't apply any transformations to message content, as I don't know how the messages look like.

ref: discord/discord-api-docs@e9711be
ref: discord/discord-api-docs@83f6c85

* don't do anything special to the messages right now

* feat: add GIF as a supported sticker format (abalabahaha#24)

ref: discord/discord-api-docs@5214f12

* feat: linked roles (abalabahaha#19)

* add role connection verification url into OAuthAppInfo

* Add Client#{edit,get}RoleConnectionMetadata

Interface may be subject to change

* add guild connection role tag

* add role connection metadata type enum

* add types

* feat(ThreadChannel): thread member pagination (abalabahaha#25)

* feat(ThreadChannel): allow fetching more details about thread members

* feat(ThreadChannel): add singular thread member fetching

* remove redundant parameter

* member data from THREAD_MEMBERS_UPDATE is sent in the member field

* handle the guild not being cached accordingly

* consistently transform options in getThreadMember

* feat: role subscriptions (abalabahaha#21)

* basic role subscription implementation

* add role subscription data to Message object

see API docs PR 5828

* align guild features with API docs

* remove TODO comment

roleSubscriptionData will be kept as a camelCased object

* fix(ThreadMember): missing Member import (abalabahaha#27)

* feat(Client): add threadID support to editWebhookMessage (abalabahaha#28)

* fix(Client): add threadID support to editWebhookMessage

* reword doc for threadID

* add threadID doc to Message#editWebhook

* update ts definitions

* fix(ShardManager): correctly emit warning on invalid intent (abalabahaha#29)

* fix(ForumChannel): document and handle nullability of certain fields

---------

Co-authored-by: Jim Chen <[email protected]>
Co-authored-by: EXPLOSION <[email protected]>
Co-authored-by: Erin <[email protected]>
Co-authored-by: Chris <[email protected]>
Co-authored-by: Donovan Daniels <[email protected]>
Co-authored-by: abal <[email protected]>
Co-authored-by: HeadTriXz <[email protected]>
Co-authored-by: Carlos Lima <[email protected]>
Co-authored-by: bsian03 <[email protected]>
Co-authored-by: isaiah <[email protected]>
Co-authored-by: Catboy <[email protected]>
Co-authored-by: HcgRandon <[email protected]>
Co-authored-by: F Robinson <[email protected]>
Co-authored-by: Alex <[email protected]>
Co-authored-by: Loliticos <[email protected]>
Co-authored-by: macdja38 <[email protected]>
Co-authored-by: Thijs Molendijk <[email protected]>
Co-authored-by: LJNeon <[email protected]>
Co-authored-by: yalpha <[email protected]>
Co-authored-by: TTtie <[email protected]>
Co-authored-by: Sham <[email protected]>
Co-authored-by: Lars_und_so <[email protected]>
Co-authored-by: Cynthia Foxwell <[email protected]>
Co-authored-by: Snazzah <[email protected]>
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.

6 participants