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(formatters): Add support for object and name param in formatEmoji() #10076

Merged
merged 3 commits into from Jan 13, 2024
Merged

refactor(formatters): Add support for object and name param in formatEmoji() #10076

merged 3 commits into from Jan 13, 2024

Conversation

ghost
Copy link

@ghost ghost commented Jan 7, 2024

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

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)

@ghost ghost self-requested a review as a code owner January 7, 2024 08:41
@ghost ghost requested review from iCrawl, Jiralite and suneettipirneni January 7, 2024 08:41
Copy link

vercel bot commented Jan 7, 2024

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

2 Ignored Deployments
Name Status Preview Comments Updated (UTC)
discord-js ⬜️ Ignored (Inspect) Visit Preview Jan 9, 2024 7:52pm
discord-js-guide ⬜️ Ignored (Inspect) Visit Preview Jan 9, 2024 7:52pm

@sdanialraza
Copy link
Contributor

There's some formatting and linting issues, could you please fix them? And it'd be nice if you added tests for the changes

packages/formatters/src/formatters.ts Outdated Show resolved Hide resolved
packages/formatters/src/formatters.ts Outdated Show resolved Hide resolved
packages/formatters/src/formatters.ts Outdated Show resolved Hide resolved
@ghost ghost requested a review from sdanialraza January 7, 2024 13:03
Copy link

codecov bot commented Jan 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (0f1e02b) 58.36% compared to head (3f0cfce) 58.51%.
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10076      +/-   ##
==========================================
+ Coverage   58.36%   58.51%   +0.15%     
==========================================
  Files         242      242              
  Lines       17184    17248      +64     
  Branches     1243     1246       +3     
==========================================
+ Hits        10029    10093      +64     
  Misses       7110     7110              
  Partials       45       45              
Flag Coverage Δ
builders 95.53% <ø> (ø)
formatters 99.31% <100.00%> (+0.04%) ⬆️
next ∅ <ø> (∅)

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.

packages/formatters/src/formatters.ts Outdated Show resolved Hide resolved
packages/formatters/src/formatters.ts Outdated Show resolved Hide resolved
packages/formatters/src/formatters.ts Outdated Show resolved Hide resolved
packages/formatters/src/formatters.ts Outdated Show resolved Hide resolved
packages/formatters/src/formatters.ts Outdated Show resolved Hide resolved
packages/formatters/src/formatters.ts Outdated Show resolved Hide resolved
packages/formatters/src/formatters.ts Outdated Show resolved Hide resolved
@jaw0r3k
Copy link
Contributor

jaw0r3k commented Jan 7, 2024

emojiId is a required parameter, so no need to pass it in options

I would do:

formatEmoji(emojiId: Snowflake, animatedOrOptions?: boolean | { name?: string, animated?: boolean } )

and animated parameter is deprecated as we recommend to use options

@ghost ghost requested a review from Jiralite January 7, 2024 14:15
@ghost ghost requested a review from sdanialraza January 7, 2024 14:38
packages/formatters/src/formatters.ts Outdated Show resolved Hide resolved
packages/formatters/src/formatters.ts Outdated Show resolved Hide resolved
packages/formatters/src/formatters.ts Outdated Show resolved Hide resolved
@ghost ghost requested a review from sdanialraza January 8, 2024 15:27
@sdanialraza
Copy link
Contributor

Just needs more overloads as Jiralite said here, other than that, looks good

@ghost ghost requested review from sdanialraza and Jiralite January 8, 2024 17:00
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.

Emoji.toString() doesn't contain the name anymore
6 participants