-
Notifications
You must be signed in to change notification settings - Fork 1.3k
openExternalLink returns a { opened: boolean | null } result
#7273
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
openExternalLink returns a { opened: boolean | null } result
#7273
Conversation
matthova
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once the SDK is merged lgtm
openExternalLink returns a { opened: boolean } resultopenExternalLink returns a { opened: boolean | null } result
|
|
||
| #### OpenExternalLinkResponse | ||
|
|
||
| > **Note:** `{ opened: null }` is returned on older Discord clients that do not report the result of the open link action. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| > **Note:** `{ opened: null }` is returned on older Discord clients that do not report the result of the open link action. | |
| > warn | |
| > `{ opened: null }` is returned on older Discord clients that do not report the result of the open link action. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there an "earliest client" we can include that would have this, or just include an approximate date (clients from before November XX, 2024)? just so when this is present, it still makes sense in a month or two
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated with the warn and to include a rough date (dec 24)
…cord#7273) * Add a response type for openExternalLink that returns a boolean opened value * updating the documentation to include the null case for older discord clients * doc update
Edit the return type for
openExternalLink. With this change the result ofopenExternalLinkwill be an object containing a boolean valueopened.If
openedis true, then the link was opened by the userIf
openedis false, then the link was not opened by the userThe lifetime of the promise is also changed. Previously the promise completed after opening the "Leaving Discord" dialog, but with this change the promise completes after the user selects an action in the dialog (visit the site, or go back). If the dialog does not appear because the site visit is automatically approved, then the promise returns
{ opened: true }following the link opening.