-
Notifications
You must be signed in to change notification settings - Fork 33
/
index.html
130 lines (111 loc) · 7.49 KB
/
index.html
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>python-telegram-bot</title>
<link rel="apple-touch-icon" sizes="57x57" href="/favicons/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="/favicons/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="/favicons/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="/favicons/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="/favicons/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="/favicons/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="/favicons/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="/favicons/apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="/favicons/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="/favicons/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="/favicons/android-chrome-192x192.png" sizes="192x192">
<link rel="icon" type="image/png" href="/favicons/favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="/favicons/favicon-16x16.png" sizes="16x16">
<link rel="manifest" href="/favicons/manifest.json">
<link rel="mask-icon" href="/favicons/safari-pinned-tab.svg" color="#5bbad5">
<link rel="shortcut icon" href="/favicons/favicon.ico">
<link rel="stylesheet" type="text/css" href="/reset.css">
<link rel="stylesheet" type="text/css" href="/style.css">
<link rel="stylesheet" type="text/css" href="/code.css">
<link rel="stylesheet" type="text/css" href="/dark.css">
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Roboto+Slab">
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Convergence">
<meta name="msapplication-TileColor" content="#2b5797">
<meta name="msapplication-TileImage" content="/favicons/mstile-144x144.png">
<meta name="msapplication-config" content="/favicons/browserconfig.xml">
<meta name="theme-color" content="#4f7096">
<meta property="og:title" content="python-telegram-bot">
<meta property="og:type" content="article">
<meta property="og:url" content="https://python-telegram-bot.org/">
<meta property="og:image" content="https://github.com/python-telegram-bot/logos/raw/master/logo/png/ptb-logo_2048.png">
<meta property="og:description" content="A Python framework for the Telegram Bot API">
<meta property="og:determiner" content="">
</head>
<body>
<a href="/">
<img class="logo" src="https://github.com/python-telegram-bot/logos/blob/master/logo/png/ptb-logo_240.png?raw=true" width="128">
</a>
<div class="content">
<section>
<header>
<hgroup>
<h1 class="title">python-telegram-bot</h1>
<h2 class="subtitle">We have made you a wrapper you can't refuse</h2>
</hgroup>
<nav>
<ul>
<li><a href="https://telegram.me/s/pythontelegrambotchannel">News</a></li>
<li><a href="https://telegram.me/pythontelegrambotgroup">Community</a></li>
<li><a href="https://github.com/python-telegram-bot/python-telegram-bot">Development</a></li>
<li><a href="https://python-telegram-bot.readthedocs.io/">Documentation</a></li>
<li><a href="https://github.com/python-telegram-bot/python-telegram-bot/wiki">Wiki</a></li>
<li><a href="https://pypi.org/project/python-telegram-bot/">Download</a></li>
</ul>
</nav>
</header>
<p class="buttons">
<a class="github-button" href="https://github.com/python-telegram-bot/python-telegram-bot" data-color-scheme="no-preference: light; light: light; dark: dark;" data-icon="octicon-star" data-show-count="true" aria-label="Star python-telegram-bot/python-telegram-bot on GitHub">Star</a>
<a class="github-button" href="https://github.com/python-telegram-bot/python-telegram-bot/fork" data-color-scheme="no-preference: light; light: light; dark: dark;" data-icon="octicon-repo-forked" data-show-count="true" aria-label="Fork python-telegram-bot/python-telegram-bot on GitHub">Fork</a>
</p>
</section>
<section>
<br><br>
<h2>It's fun</h2>
<div class="window">
<div class="window-header">
<div class="action-buttons"></div>
</div>
<pre>
<span></span><span class="kn">from</span> <span class="nn">telegram</span> <span class="kn">import</span> <span class="n">Update</span>
<span class="kn">from</span> <span class="nn">telegram.ext</span> <span class="kn">import</span> <span class="n">ApplicationBuilder</span><span class="p">,</span> <span class="n">CommandHandler</span><span class="p">,</span> <span class="n">ContextTypes</span>
<span class="k">async</span> <span class="k">def</span> <span class="nf">hello</span><span class="p">(</span><span class="n">update</span><span class="p">:</span> <span class="n">Update</span><span class="p">,</span> <span class="n">context</span><span class="p">:</span> <span class="n">ContextTypes</span><span class="o">.</span><span class="n">DEFAULT_TYPE</span><span class="p">)</span> <span class="o">-></span> <span class="kc">None</span><span class="p">:</span>
<span class="k">await</span> <span class="n">update</span><span class="o">.</span><span class="n">message</span><span class="o">.</span><span class="n">reply_text</span><span class="p">(</span><span class="sa">f</span><span class="s1">'Hello </span><span class="si">{</span><span class="n">update</span><span class="o">.</span><span class="n">effective_user</span><span class="o">.</span><span class="n">first_name</span><span class="si">}</span><span class="s1">'</span><span class="p">)</span>
<span class="n">app</span> <span class="o">=</span> <span class="n">ApplicationBuilder</span><span class="p">()</span><span class="o">.</span><span class="n">token</span><span class="p">(</span><span class="s2">"YOUR TOKEN HERE"</span><span class="p">)</span><span class="o">.</span><span class="n">build</span><span class="p">()</span>
<span class="n">app</span><span class="o">.</span><span class="n">add_handler</span><span class="p">(</span><span class="n">CommandHandler</span><span class="p">(</span><span class="s2">"hello"</span><span class="p">,</span> <span class="n">hello</span><span class="p">))</span>
<span class="n">app</span><span class="o">.</span><span class="n">run_polling</span><span class="p">()</span>
</pre>
</div>
<br>
<h2>Easy to setup</h2>
<div class="window">
<div class="window-header">
<div class="action-buttons"></div>
</div>
<pre><span class="gi">$</span> <span class="c"># This installs the latest stable release</span>
<span class="gi">$</span> pip install python-telegram-bot --upgrade
<span class="gi">$</span> python bot.py</pre>
</div>
<br>
<div>You can also <a href="/verify-releases.html">verify releases</a>.</div>
<br>
<h2>And it is free</h2>
<p>python-telegram-bot is distributed under a
<a href="https://www.gnu.org/licenses/lgpl-3.0.html">LGPLv3 license.</a>
</p>
</section>
</div>
<section>
<footer>
<p class="left"><a href="https://www.jetbrains.com/pycharm/"><img src="/pycharm.png" alt="PyCharm Logo" width="43" height="43"></a> </p>
<p class="left"><a href="/sponsors.html#jetbrains">Made with<br>PyCharm</a></p>
<p class="right">© Copyright 2015-2024. Licensed by <a href="https://creativecommons.org/licenses/by/3.0/" rel="license" target="_blank">Creative Commons</a>.</p>
</footer>
</section>
<script async="" defer="" id="github-bjs" src="https://buttons.github.io/buttons.js"></script>
</body>
</html>