Skip to content

Commit

Permalink
types: use Snowflake type (#5717)
Browse files Browse the repository at this point in the history
* types: use Snowflake type

* Update typings/index.d.ts

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

Co-authored-by: Jan <[email protected]>
  • Loading branch information
iCrawl and vaporoxx authored May 31, 2021
1 parent d52bcd4 commit 76db642
Show file tree
Hide file tree
Showing 3 changed files with 2,368 additions and 4,685 deletions.
Loading

2 comments on commit 76db642

@JMTK
Copy link
Contributor

@JMTK JMTK commented on 76db642 Jun 1, 2021

Choose a reason for hiding this comment

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

After this merge, my cache get's give the error Argument of type 'string' is not assignable to parameter of type '\${bigint}`'`
image
Example:

let channelID : string = SavedChannelIDFromSomewhere;
mybot.channels.cache.get(channelID)

When I view the Snowflake reference on master, it still mentions the type string being acceptable. Should I be modifying all of my variable types to be bigint instead of string for these? In my data store, they're stored as bigint so it's not that big of a deal, it's more of a question of semantics of using these methods.
https://discord.js.org/#/docs/main/master/typedef/Snowflake

@iCrawl
Copy link
Member Author

@iCrawl iCrawl commented on 76db642 Jun 1, 2021

Choose a reason for hiding this comment

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

This is surely not the right place to ask this.

However, yes. Snowflakes are numbers in a string format and this commit tightened the rules for this quite a bit.

Please sign in to comment.