FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-telegram-bot/examples/webappbot.html at master · python-telegram-bot/python-telegram-bot · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
python-telegram-bot
/
python-telegram-bot
Public
Notifications
You must be signed in to change notification settings
Fork
6.1k
Star
29.4k
Code
Issues
24
Pull requests
15
Discussions
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
python-telegram-bot
/
examples
/
webappbot.html
Copy path
More file actions
More file actions
Latest commit
History
History
History
39 lines (38 loc) · 1.46 KB
Breadcrumbs
python-telegram-bot
/
examples
/
webappbot.html
Copy path
File metadata and controls
39 lines (38 loc) · 1.46 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<!--
Simple static Telegram WebApp. Does not verify the WebAppInitData, as a bot token would be needed for that.
-->
<!DOCTYPE html
>
<
html
lang
="
en
"
>
<
head
>
<
meta
charset
="
UTF-8
"
>
<
title
>
python-telegram-bot Example WebApp
</
title
>
<
script
src
="
https://telegram.org/js/telegram-web-app.js
"
>
</
script
>
<
script
src
="
https://cdn.jsdelivr.net/npm/@jaames/iro@5
"
>
</
script
>
</
head
>
<
script
type
="
text/javascript
"
>
const
colorPicker
=
new
iro
.
ColorPicker
(
'#picker'
,
{
borderColor
:
"#ffffff"
,
borderWidth
:
1
,
width
:
Math
.
round
(
document
.
documentElement
.
clientWidth
/
2
)
,
}
)
;
colorPicker
.
on
(
'color:change'
,
function
(
color
)
{
document
.
body
.
style
.
background
=
color
.
hexString
;
}
)
;
Telegram
.
WebApp
.
ready
(
)
;
Telegram
.
WebApp
.
MainButton
.
setText
(
'Choose Color'
)
.
show
(
)
.
onClick
(
function
(
)
{
const
data
=
JSON
.
stringify
(
{
hex
:
colorPicker
.
color
.
hexString
,
rgb
:
colorPicker
.
color
.
rgb
}
)
;
Telegram
.
WebApp
.
sendData
(
data
)
;
Telegram
.
WebApp
.
close
(
)
;
}
)
;
</
script
>
<
body
style
="
background-color: #ffffff
"
>
<
div
style
="
position: absolute; margin-top: 5vh; margin-left: 5vw; height: 90vh; width: 90vw; border-radius: 5vh; background-color: var(--tg-theme-bg-color); box-shadow: 0 0 2vw
#000000;
"
>
<
div
id
="
picker
"
style
="
display: flex; justify-content: center; align-items: center; height: 100%; width: 100%
"
>
</
div
>
</
div
>
</
body
>
<
script
type
="
text/javascript
"
>
Telegram
.
WebApp
.
expand
(
)
;
</
script
>
</
html
>
Back
|
FazBrowse Home
|
New Git URL