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

refactor(GuildChannelManager): Remove redundant edit code #10370

Merged
merged 2 commits into from
Jul 10, 2024

Conversation

Jiralite
Copy link
Member

Please describe the changes this PR makes and why it should be merged:
Removes redundant code, such as this:

- (options.name ?? channel.name).trim(),
+ options.name,

In this example, .trim() is redundant as the API performs trimming. The ?? is also redundant (here and later in the code) as the properties are optional. Methods like these work just fine still:

await channel.setRTCRegion(null);

// " hello " is trimmed API-side.
await channel.edit({ name: " hello ", bitrate: 96000, userLimit: 13, rtcRegion: null });

Also avoided reassigning the parameter.

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

Copy link

vercel bot commented Jun 30, 2024

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

2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
discord-js ⬜️ Ignored (Inspect) Visit Preview Jul 10, 2024 1:35pm
discord-js-guide ⬜️ Ignored (Inspect) Visit Preview Jul 10, 2024 1:35pm

Copy link
Member

@SpaceEEC SpaceEEC left a comment

Choose a reason for hiding this comment

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

👍

Copy link

codecov bot commented Jul 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 50.52%. Comparing base (3654efe) to head (8ac7876).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10370      +/-   ##
==========================================
+ Coverage   50.38%   50.52%   +0.14%     
==========================================
  Files         228      228              
  Lines       20633    20705      +72     
  Branches     1236     1252      +16     
==========================================
+ Hits        10396    10462      +66     
- Misses      10193    10199       +6     
  Partials       44       44              
Flag Coverage Δ
builders 95.78% <ø> (-0.12%) ⬇️
formatters 99.33% <ø> (+0.02%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kodiakhq kodiakhq bot merged commit 9461045 into main Jul 10, 2024
25 checks passed
@kodiakhq kodiakhq bot deleted the refactor/redundant-edit-code branch July 10, 2024 13:41
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.

4 participants