8000 GuildFeature is not a two-way enum · Issue #583 · discordjs/discord-api-types · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
GuildFeature is not a two-way enum #583
Open
@MattIPv4

Description

@MattIPv4

Please describe the problem you are having in as much detail as possible:

Many of the enums exported from discord-api-types are two-way enums, meaning that you can pass a key into the enum, and than that result back into the enum again to get the original key. This is true of the ChannelType enum for example, which has both the integer and string values as keys.

However, the GuildFeature enum only has the PascalCase values as keys, with the SCREAMING_SNAKE_CASE values missing from the keys. This means that you cannot convert the snake case values back to the pascal case values using the enum.

Include a reproducible code sample here, if possible:

import { ChannelType, GuildFeature } from 'discord-api-types';

console.log(ChannelType[ChannelType[0]]); // 0
console.log(GuildFeature[GuildFeature['Banner']]); // undefined

Further details:

  • Runtime:
    • Node.js version: 16.17.0
  • Priority this issue should have – please be realistic and elaborate if possible: P3, I can manually patch in my own enum for now, but inconsistency in the exports is no fun :(

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0