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

Fix Embedded App SDK doc for setOrientationLockState() #6759

Closed
wants to merge 2 commits into from

Conversation

Snazzah
Copy link
Contributor

@Snazzah Snazzah commented Mar 27, 2024

Seems like this command doesn't actually need the guilds.members.read scope, and the values in the usage doesn't use strings.

Copy link
Contributor

@Lulalaby Lulalaby left a comment

Choose a reason for hiding this comment

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

A table should maybe be included for the mapping from int to flag

#### Lock States
| Type | State      |
| ==== | ========== |
| 1    | Unlocked   |
| 2    | Portrait   |
| 3    | Landscape  |

#### Grid Lock States
| Type | State    |
| ==== | ======== |
| 1    | Unlocked |
| 2    | Locked   |

@colinloretz
Copy link
Contributor

@Snazzah thanks for this! I'll take a peek. These are currently manually written but will be auto-generated soon™️, so we'll have things like types/etc included in tables.

@colinloretz colinloretz self-requested a review March 27, 2024 18:12
@@ -493,15 +493,15 @@ Locks the application to specific orientations in each of the supported layout m

#### Required Scopes

- guilds.members.read
No scopes required
Copy link
Contributor

Choose a reason for hiding this comment

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

Great callout. Yes, no scopes are required for this command.

Comment on lines +502 to +504
lock_state: 3, // landscape
picture_in_picture_lock_state: 3, // landscape
grid_lock_state: 1 // unlocked
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a rough edge case where we offer an enum, but getting to it is a bit verbose

Suggested change
lock_state: 3, // landscape
picture_in_picture_lock_state: 3, // landscape
grid_lock_state: 1 // unlocked
lock_state: Common.OrientationLockStateTypeObject.LANDSCAPE,
picture_in_picture_lock_state: Common.OrientationLockStateTypeObject.LANDSCAPE,
grid_lock_state: Common.OrientationLockStateTypeObject.UNLOCKED

Ideally we could also show above this snippet

import {Common} from '@discord/embedded-app-sdk';

@JustinBeckwith JustinBeckwith added embedded-app-sdk Feedback and bug reports on Embedded App SDK waiting for response Discord is waiting for a response and will re-triage the issue at a later point labels May 13, 2024
@JustinBeckwith
Copy link
Contributor

Thanks for surfacing the issue! Addressed in #6863

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
embedded-app-sdk Feedback and bug reports on Embedded App SDK waiting for response Discord is waiting for a response and will re-triage the issue at a later point
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants