Last active
May 1, 2023 12:05
-
-
Save slavafomin/f22c8e2e9317685b95b7cd6ce846499b to your computer and use it in GitHub Desktop.
TWA Main Button Emulation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { WebApp } from '@grammyjs/web-app'; | |
export function isTwa(): boolean { | |
return ( | |
Boolean(WebApp.initData) || | |
(WebApp.platform !== 'unknown') | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment