Suggestion: Discord permission bitfield type should be either `string` or `bigint` consistently instead of `number`

Open
#9 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Stale
Tech stack
typescript
Domain
api

Research direction

Start by locating the Discord REST types UpdateGuildRoleRequest, ApplicationCommandUpdateRequest, and ApplicationCommandResponse, then compare their permission field types with the dfx Perms helper. Decide whether the permission representation should consistently be string or bigint, update the affected types, and verify the REST type checks.

Written by the indexing model from the issue text.

Description

Currently discord rest types such as UpdateGuildRoleRequest and ApplicationCommandUpdateRequest use number type for permissions while some others (like ApplicationCommandResponse) use string. AFAIK discord API itself uses strings for permissions and dfx Perms helper uses bigint, so number is really inconvenient here. I suggest using either string or bigint consistently instead.

Dominant language
TypeScript
Stars
145
Forks
6
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from tim-smart/dfx

All issues in tim-smart/dfx

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.