Skip to content

Commit

Permalink
Merge pull request #21 from akbarali1/master
Browse files Browse the repository at this point in the history
Adding  isVersionAtLeast and doesntSupport function
  • Loading branch information
revenkroz authored Mar 28, 2024
2 parents e259f09 + 6f5cb67 commit a03c3d8
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,21 @@
}
});
},
isVersionAtLeast(version) {
return Telegram.WebApp.isVersionAtLeast(version);
},
//version to string Example: '6.9'
doesntSupport(version) {
// console.log("version: " + version);
// console.log("realVersion: " + this.version());
// console.log("doesntSupport: " + this.isVersionAtLeast(version));
if (!this.isVersionAtLeast(version)) {
Telegram.WebApp.showAlert('This feature is not supported in this version of Telegram', function () {
Telegram.WebApp.close();
});
throw new Error('This feature is not supported in this version of Telegram');
}
},
showPopup() {
Telegram.WebApp.showPopup({
title : 'Popup title',
Expand Down

0 comments on commit a03c3d8

Please sign in to comment.