grammy 1.5.2 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -11
- package/out/bot.js +5 -2
- package/out/composer.js +1 -1
- package/out/context.d.ts +1 -1
- package/out/convenience/keyboard.d.ts +9 -9
- package/out/convenience/keyboard.js +9 -9
- package/out/convenience/session.d.ts +12 -1
- package/out/convenience/session.js +13 -0
- package/out/core/api.d.ts +1 -1
- package/out/core/payload.js +2 -0
- package/out/filter.js +1 -3
- package/out/platform.node.js +2 -2
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@ _<h2 align="center"> [:mag: Documentation](https://grammy.dev) | [:page_with_cur
|
|
|
12
12
|
|
|
13
13
|
[](https://core.telegram.org/bots/api)
|
|
14
14
|
[](https://www.npmjs.org/package/grammy) <!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
|
|
15
|
-
[](#contributors-)
|
|
16
16
|
<!-- ALL-CONTRIBUTORS-BADGE:END -->
|
|
17
17
|
|
|
18
18
|
<!-- deno-fmt-ignore-end -->
|
|
@@ -108,6 +108,16 @@ However, given that most bot developers are still using Node.js, all documentati
|
|
|
108
108
|
|
|
109
109
|
You may also be interested in [why we support Deno](https://grammy.dev/resources/faq.html#why-do-you-support-deno).
|
|
110
110
|
|
|
111
|
+
## Browser Support
|
|
112
|
+
|
|
113
|
+
The grammY core package in this repository is avaiable as a JavaScript bundle from the CDN at `get.grammy.dev`.
|
|
114
|
+
Currently, we transpile all stable versions (all releases since v1.0) as well as the current `main` branch to ES3, ES5, ES6, and ESNext.
|
|
115
|
+
|
|
116
|
+
You can download them from the URL `https://get.grammy.dev/[ES version lowercased]@[grammY version including v-prefix].js`.
|
|
117
|
+
For example, the most recent source on `main` in ES6 is available from <https://get.grammy.dev/es6@dev.js>.
|
|
118
|
+
|
|
119
|
+
So far, this is mainly useful for running bots on Cloudflare Workers.
|
|
120
|
+
|
|
111
121
|
## [Contribution Guide »](./CONTRIBUTING.md)
|
|
112
122
|
|
|
113
123
|
## Contributors ✨
|
|
@@ -119,18 +129,18 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
|
|
|
119
129
|
<!-- markdownlint-disable -->
|
|
120
130
|
<table>
|
|
121
131
|
<tr>
|
|
122
|
-
<td align="center"><a href="https://github.com/KnorpelSenf"><img src="https://avatars.githubusercontent.com/u/12952387?v=4?s=100" width="100px;" alt=""/><br /><sub><b>KnorpelSenf</b></sub></a><br /><a href="#ideas-KnorpelSenf" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/grammyjs/grammY/commits?author=KnorpelSenf" title="Code">💻</a> <a href="https://github.com/grammyjs/grammY/commits?author=KnorpelSenf" title="Documentation">📖</a> <a href="#design-KnorpelSenf" title="Design">🎨</a> <a href="#example-KnorpelSenf" title="Examples">💡</a> <a href="
|
|
123
|
-
<td align="center"><a href="https://github.com/Tecardo1"><img src="https://avatars.githubusercontent.com/u/42873000?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Tecardo1</b></sub></a><br /><a href="#plugin-Tecardo1" title="Plugin/utility libraries">🔌</a> <a href="#userTesting-Tecardo1" title="User Testing">📓</a></td>
|
|
124
|
-
<td align="center"><a href="https://github.com/wojpawlik"><img src="https://avatars.githubusercontent.com/u/23058303?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Wojciech Pawlik</b></sub></a><br /><a href="#ideas-wojpawlik" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/grammyjs/grammY/pulls?q=is%3Apr+reviewed-by%3Awojpawlik" title="Reviewed Pull Requests">👀</a> <a href="#infra-wojpawlik" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="#platform-wojpawlik" title="Packaging/porting to new platform">📦</a></td>
|
|
132
|
+
<td align="center"><a href="https://github.com/KnorpelSenf"><img src="https://avatars.githubusercontent.com/u/12952387?v=4?s=100" width="100px;" alt=""/><br /><sub><b>KnorpelSenf</b></sub></a><br /><a href="#ideas-KnorpelSenf" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/grammyjs/grammY/commits?author=KnorpelSenf" title="Code">💻</a> <a href="https://github.com/grammyjs/grammY/commits?author=KnorpelSenf" title="Documentation">📖</a> <a href="#design-KnorpelSenf" title="Design">🎨</a> <a href="#example-KnorpelSenf" title="Examples">💡</a> <a href="https://github.com/grammyjs/grammY/commits?author=KnorpelSenf" title="Tests">⚠️</a> <a href="#plugin-KnorpelSenf" title="Plugin/utility libraries">🔌</a> <a href="#platform-KnorpelSenf" title="Packaging/porting to new platform">📦</a> <a href="https://github.com/grammyjs/grammY/pulls?q=is%3Apr+reviewed-by%3AKnorpelSenf" title="Reviewed Pull Requests">👀</a> <a href="#mentoring-KnorpelSenf" title="Mentoring">🧑🏫</a> <a href="#projectManagement-KnorpelSenf" title="Project Management">📆</a> <a href="#infra-KnorpelSenf" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
|
|
133
|
+
<td align="center"><a href="https://github.com/Tecardo1"><img src="https://avatars.githubusercontent.com/u/42873000?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Tecardo1</b></sub></a><br /><a href="#plugin-Tecardo1" title="Plugin/utility libraries">🔌</a> <a href="#userTesting-Tecardo1" title="User Testing">📓</a> <a href="#example-Tecardo1" title="Examples">💡</a> <a href="https://github.com/grammyjs/grammY/commits?author=Tecardo1" title="Documentation">📖</a> <a href="https://github.com/grammyjs/grammY/pulls?q=is%3Apr+reviewed-by%3ATecardo1" title="Reviewed Pull Requests">👀</a></td>
|
|
134
|
+
<td align="center"><a href="https://github.com/wojpawlik"><img src="https://avatars.githubusercontent.com/u/23058303?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Wojciech Pawlik</b></sub></a><br /><a href="#ideas-wojpawlik" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/grammyjs/grammY/pulls?q=is%3Apr+reviewed-by%3Awojpawlik" title="Reviewed Pull Requests">👀</a> <a href="#infra-wojpawlik" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="#platform-wojpawlik" title="Packaging/porting to new platform">📦</a> <a href="#tool-wojpawlik" title="Tools">🔧</a></td>
|
|
125
135
|
<td align="center"><a href="https://github.com/MegaITA"><img src="https://avatars.githubusercontent.com/u/32493080?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Alessandro Bertozzi</b></sub></a><br /><a href="https://github.com/grammyjs/grammY/commits?author=MegaITA" title="Documentation">📖</a></td>
|
|
126
136
|
<td align="center"><a href="https://trgwii.no/"><img src="https://avatars.githubusercontent.com/u/11262022?v=4?s=100" width="100px;" alt=""/><br /><sub><b>trgwii</b></sub></a><br /><a href="https://github.com/grammyjs/grammY/commits?author=trgwii" title="Code">💻</a> <a href="https://github.com/grammyjs/grammY/pulls?q=is%3Apr+reviewed-by%3Atrgwii" title="Reviewed Pull Requests">👀</a></td>
|
|
127
137
|
<td align="center"><a href="https://github.com/KnightNiwrem"><img src="https://avatars.githubusercontent.com/u/9781814?v=4?s=100" width="100px;" alt=""/><br /><sub><b>KnightNiwrem</b></sub></a><br /><a href="https://github.com/grammyjs/grammY/commits?author=KnightNiwrem" title="Code">💻</a> <a href="https://github.com/grammyjs/grammY/issues?q=author%3AKnightNiwrem" title="Bug reports">🐛</a> <a href="#plugin-KnightNiwrem" title="Plugin/utility libraries">🔌</a> <a href="https://github.com/grammyjs/grammY/commits?author=KnightNiwrem" title="Documentation">📖</a> <a href="#example-KnightNiwrem" title="Examples">💡</a> <a href="https://github.com/grammyjs/grammY/pulls?q=is%3Apr+reviewed-by%3AKnightNiwrem" title="Reviewed Pull Requests">👀</a> <a href="#mentoring-KnightNiwrem" title="Mentoring">🧑🏫</a></td>
|
|
128
138
|
<td align="center"><a href="https://mkr.pw"><img src="https://avatars.githubusercontent.com/u/19621208?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Muthu Kumar</b></sub></a><br /><a href="https://github.com/grammyjs/grammY/pulls?q=is%3Apr+reviewed-by%3AMKRhere" title="Reviewed Pull Requests">👀</a></td>
|
|
129
139
|
</tr>
|
|
130
140
|
<tr>
|
|
131
|
-
<td align="center"><a href="https://edjopato.de/"><img src="https://avatars.githubusercontent.com/u/7953011?v=4?s=100" width="100px;" alt=""/><br /><sub><b>EdJoPaTo</b></sub></a><br /><a href="#plugin-EdJoPaTo" title="Plugin/utility libraries">🔌</a> <a href="https://github.com/grammyjs/grammY/commits?author=EdJoPaTo" title="Documentation">📖</a> <a href="#ideas-EdJoPaTo" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/grammyjs/grammY/pulls?q=is%3Apr+reviewed-by%3AEdJoPaTo" title="Reviewed Pull Requests">👀</a> <a href="https://github.com/grammyjs/grammY/issues?q=author%3AEdJoPaTo" title="Bug reports">🐛</a> <a href="https://github.com/grammyjs/grammY/commits?author=EdJoPaTo" title="Code">💻</a
|
|
132
|
-
<td align="center"><a href="https://github.com/Amir-Zouerami"><img src="https://avatars.githubusercontent.com/u/53701884?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Amir Zouerami</b></sub></a><br /><a href="https://github.com/grammyjs/grammY/commits?author=Amir-Zouerami" title="Documentation">📖</a> <a href="#plugin-Amir-Zouerami" title="Plugin/utility libraries">🔌</a></td>
|
|
133
|
-
<td align="center"><a href="https://github.com/
|
|
141
|
+
<td align="center"><a href="https://edjopato.de/"><img src="https://avatars.githubusercontent.com/u/7953011?v=4?s=100" width="100px;" alt=""/><br /><sub><b>EdJoPaTo</b></sub></a><br /><a href="#plugin-EdJoPaTo" title="Plugin/utility libraries">🔌</a> <a href="https://github.com/grammyjs/grammY/commits?author=EdJoPaTo" title="Documentation">📖</a> <a href="#ideas-EdJoPaTo" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/grammyjs/grammY/pulls?q=is%3Apr+reviewed-by%3AEdJoPaTo" title="Reviewed Pull Requests">👀</a> <a href="https://github.com/grammyjs/grammY/issues?q=author%3AEdJoPaTo" title="Bug reports">🐛</a> <a href="https://github.com/grammyjs/grammY/commits?author=EdJoPaTo" title="Code">💻</a></td>
|
|
142
|
+
<td align="center"><a href="https://github.com/Amir-Zouerami"><img src="https://avatars.githubusercontent.com/u/53701884?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Amir Zouerami</b></sub></a><br /><a href="https://github.com/grammyjs/grammY/commits?author=Amir-Zouerami" title="Documentation">📖</a> <a href="#plugin-Amir-Zouerami" title="Plugin/utility libraries">🔌</a> <a href="#example-Amir-Zouerami" title="Examples">💡</a></td>
|
|
143
|
+
<td align="center"><a href="https://github.com/roj1512"><img src="https://avatars.githubusercontent.com/u/49933115?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Roj</b></sub></a><br /><a href="https://github.com/grammyjs/grammY/commits?author=roj1512" title="Documentation">📖</a> <a href="https://github.com/grammyjs/grammY/pulls?q=is%3Apr+reviewed-by%3Aroj1512" title="Reviewed Pull Requests">👀</a> <a href="#infra-roj1512" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="#translation-roj1512" title="Translation">🌍</a> <a href="https://github.com/grammyjs/grammY/commits?author=roj1512" title="Code">💻</a> <a href="#ideas-roj1512" title="Ideas, Planning, & Feedback">🤔</a> <a href="#mentoring-roj1512" title="Mentoring">🧑🏫</a></td>
|
|
134
144
|
<td align="center"><a href="https://github.com/jokasimr"><img src="https://avatars.githubusercontent.com/u/20954731?v=4?s=100" width="100px;" alt=""/><br /><sub><b>jokasimr</b></sub></a><br /><a href="https://github.com/grammyjs/grammY/issues?q=author%3Ajokasimr" title="Bug reports">🐛</a></td>
|
|
135
145
|
<td align="center"><a href="https://github.com/CikiMomogi"><img src="https://avatars.githubusercontent.com/u/74030149?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Ciki Momogi</b></sub></a><br /><a href="https://github.com/grammyjs/grammY/commits?author=CikiMomogi" title="Documentation">📖</a></td>
|
|
136
146
|
<td align="center"><a href="https://github.com/AndreoliBR"><img src="https://avatars.githubusercontent.com/u/15970011?v=4?s=100" width="100px;" alt=""/><br /><sub><b>AndreoliBR</b></sub></a><br /><a href="https://github.com/grammyjs/grammY/pulls?q=is%3Apr+reviewed-by%3AAndreoliBR" title="Reviewed Pull Requests">👀</a></td>
|
|
@@ -142,8 +152,8 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
|
|
|
142
152
|
<td align="center"><a href="https://beta.ku-di.com/waptik"><img src="https://avatars.githubusercontent.com/u/1687551?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Stephane Mensah</b></sub></a><br /><a href="https://github.com/grammyjs/grammY/issues?q=author%3Awaptik" title="Bug reports">🐛</a> <a href="#plugin-waptik" title="Plugin/utility libraries">🔌</a></td>
|
|
143
153
|
<td align="center"><a href="https://github.com/Asaku01"><img src="https://avatars.githubusercontent.com/u/29716396?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Asaku01</b></sub></a><br /><a href="https://github.com/grammyjs/grammY/commits?author=Asaku01" title="Documentation">📖</a></td>
|
|
144
154
|
<td align="center"><a href="https://github.com/ppsimn"><img src="https://avatars.githubusercontent.com/u/88509883?v=4?s=100" width="100px;" alt=""/><br /><sub><b>ppsimn</b></sub></a><br /><a href="https://github.com/grammyjs/grammY/issues?q=author%3Appsimn" title="Bug reports">🐛</a></td>
|
|
145
|
-
<td align="center"><a href="https://satont.js.org/"><img src="https://avatars.githubusercontent.com/u/42675886?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Satont</b></sub></a><br /><a href="#plugin-Satont" title="Plugin/utility libraries">🔌</a></td>
|
|
146
|
-
<td align="center"><a href="https://github.com/deptyped"><img src="https://avatars.githubusercontent.com/u/26162440?v=4?s=100" width="100px;" alt=""/><br /><sub><b>deptyped</b></sub></a><br /><a href="#example-deptyped" title="Examples">💡</a> <a href="https://github.com/grammyjs/grammY/commits?author=deptyped" title="Documentation">📖</a> <a href="#tutorial-deptyped" title="Tutorials">✅</a
|
|
155
|
+
<td align="center"><a href="https://satont.js.org/"><img src="https://avatars.githubusercontent.com/u/42675886?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Satont</b></sub></a><br /><a href="#plugin-Satont" title="Plugin/utility libraries">🔌</a> <a href="https://github.com/grammyjs/grammY/commits?author=Satont" title="Documentation">📖</a></td>
|
|
156
|
+
<td align="center"><a href="https://github.com/deptyped"><img src="https://avatars.githubusercontent.com/u/26162440?v=4?s=100" width="100px;" alt=""/><br /><sub><b>deptyped</b></sub></a><br /><a href="#example-deptyped" title="Examples">💡</a> <a href="https://github.com/grammyjs/grammY/commits?author=deptyped" title="Documentation">📖</a> <a href="#tutorial-deptyped" title="Tutorials">✅</a></td>
|
|
147
157
|
</tr>
|
|
148
158
|
<tr>
|
|
149
159
|
<td align="center"><a href="https://github.com/dzek69"><img src="https://avatars.githubusercontent.com/u/4936805?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Jacek Nowacki</b></sub></a><br /><a href="https://github.com/grammyjs/grammY/commits?author=dzek69" title="Documentation">📖</a> <a href="https://github.com/grammyjs/grammY/commits?author=dzek69" title="Code">💻</a> <a href="https://github.com/grammyjs/grammY/issues?q=author%3Adzek69" title="Bug reports">🐛</a> <a href="https://github.com/grammyjs/grammY/pulls?q=is%3Apr+reviewed-by%3Adzek69" title="Reviewed Pull Requests">👀</a> <a href="#ideas-dzek69" title="Ideas, Planning, & Feedback">🤔</a></td>
|
|
@@ -167,15 +177,18 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
|
|
|
167
177
|
<td align="center"><a href="https://github.com/taotie111"><img src="https://avatars.githubusercontent.com/u/44166322?v=4?s=100" width="100px;" alt=""/><br /><sub><b>taotie111</b></sub></a><br /><a href="https://github.com/grammyjs/grammY/commits?author=taotie111" title="Documentation">📖</a> <a href="#translation-taotie111" title="Translation">🌍</a></td>
|
|
168
178
|
<td align="center"><a href="https://www.linkedin.com/in/merlin-brandes-42328717a/"><img src="https://avatars.githubusercontent.com/u/14237330?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Merlin</b></sub></a><br /><a href="https://github.com/grammyjs/grammY/commits?author=FatalMerlin" title="Documentation">📖</a></td>
|
|
169
179
|
<td align="center"><a href="https://darve.sh"><img src="https://avatars.githubusercontent.com/u/22394081?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Darvesh</b></sub></a><br /><a href="https://github.com/grammyjs/grammY/issues?q=author%3Adarvesh" title="Bug reports">🐛</a> <a href="https://github.com/grammyjs/grammY/commits?author=darvesh" title="Code">💻</a></td>
|
|
170
|
-
<td align="center"><a href="http://telegram.me/dcdunkan"><img src="https://avatars.githubusercontent.com/u/70066170?v=4?s=100" width="100px;" alt=""/><br /><sub><b>dcdunkan</b></sub></a><br /><a href="https://github.com/grammyjs/grammY/issues?q=author%3Adcdunkan" title="Bug reports">🐛</a> <a href="https://github.com/grammyjs/grammY/commits?author=dcdunkan" title="Code">💻</a> <a href="#plugin-dcdunkan" title="Plugin/utility libraries">🔌</a> <a href="https://github.com/grammyjs/grammY/pulls?q=is%3Apr+reviewed-by%3Adcdunkan" title="Reviewed Pull Requests">👀</a></td>
|
|
180
|
+
<td align="center"><a href="http://telegram.me/dcdunkan"><img src="https://avatars.githubusercontent.com/u/70066170?v=4?s=100" width="100px;" alt=""/><br /><sub><b>dcdunkan</b></sub></a><br /><a href="https://github.com/grammyjs/grammY/issues?q=author%3Adcdunkan" title="Bug reports">🐛</a> <a href="https://github.com/grammyjs/grammY/commits?author=dcdunkan" title="Code">💻</a> <a href="#plugin-dcdunkan" title="Plugin/utility libraries">🔌</a> <a href="https://github.com/grammyjs/grammY/pulls?q=is%3Apr+reviewed-by%3Adcdunkan" title="Reviewed Pull Requests">👀</a> <a href="https://github.com/grammyjs/grammY/commits?author=dcdunkan" title="Documentation">📖</a></td>
|
|
171
181
|
<td align="center"><a href="https://xuann.wang/"><img src="https://avatars.githubusercontent.com/u/44045911?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Kid</b></sub></a><br /><a href="https://github.com/grammyjs/grammY/commits?author=kidonng" title="Documentation">📖</a> <a href="#translation-kidonng" title="Translation">🌍</a></td>
|
|
172
182
|
<td align="center"><a href="http://slava.fomin.io/"><img src="https://avatars.githubusercontent.com/u/1702725?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Slava Fomin II</b></sub></a><br /><a href="https://github.com/grammyjs/grammY/issues?q=author%3Aslavafomin" title="Bug reports">🐛</a> <a href="https://github.com/grammyjs/grammY/commits?author=slavafomin" title="Documentation">📖</a></td>
|
|
173
183
|
<td align="center"><a href="https://kikobeats.com/"><img src="https://avatars.githubusercontent.com/u/2096101?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Kiko Beats</b></sub></a><br /><a href="https://github.com/grammyjs/grammY/commits?author=Kikobeats" title="Documentation">📖</a></td>
|
|
174
184
|
</tr>
|
|
175
185
|
<tr>
|
|
176
186
|
<td align="center"><a href="http://///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////kraftwerk28.pp.ua"><img src="https://avatars.githubusercontent.com/u/31807671?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Vsevolod</b></sub></a><br /><a href="https://github.com/grammyjs/grammY/commits?author=kraftwerk28" title="Code">💻</a> <a href="#ideas-kraftwerk28" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/grammyjs/grammY/pulls?q=is%3Apr+reviewed-by%3Akraftwerk28" title="Reviewed Pull Requests">👀</a></td>
|
|
177
|
-
<td align="center"><a href="https://github.com/habemuscode"><img src="https://avatars.githubusercontent.com/u/34692207?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Habemuscode</b></sub></a><br /><a href="https://github.com/grammyjs/grammY/pulls?q=is%3Apr+reviewed-by%3Ahabemuscode" title="Reviewed Pull Requests">👀</a></td>
|
|
187
|
+
<td align="center"><a href="https://github.com/habemuscode"><img src="https://avatars.githubusercontent.com/u/34692207?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Habemuscode</b></sub></a><br /><a href="https://github.com/grammyjs/grammY/pulls?q=is%3Apr+reviewed-by%3Ahabemuscode" title="Reviewed Pull Requests">👀</a> <a href="https://github.com/grammyjs/grammY/commits?author=habemuscode" title="Documentation">📖</a></td>
|
|
178
188
|
<td align="center"><a href="https://borodutch.com/"><img src="https://avatars.githubusercontent.com/u/3192028?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Nikita Kolmogorov</b></sub></a><br /><a href="#plugin-backmeupplz" title="Plugin/utility libraries">🔌</a></td>
|
|
189
|
+
<td align="center"><a href="http://glukki.ru"><img src="https://avatars.githubusercontent.com/u/140462?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Vitaliy Meshchaninov</b></sub></a><br /><a href="https://github.com/grammyjs/grammY/issues?q=author%3Aglukki" title="Bug reports">🐛</a> <a href="https://github.com/grammyjs/grammY/commits?author=glukki" title="Code">💻</a></td>
|
|
190
|
+
<td align="center"><a href="https://github.com/dilyanpalauzov"><img src="https://avatars.githubusercontent.com/u/4992947?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Дилян Палаузов</b></sub></a><br /><a href="https://github.com/grammyjs/grammY/issues?q=author%3Adilyanpalauzov" title="Bug reports">🐛</a> <a href="https://github.com/grammyjs/grammY/commits?author=dilyanpalauzov" title="Code">💻</a></td>
|
|
191
|
+
<td align="center"><a href="https://github.com/lmx-Hexagram"><img src="https://avatars.githubusercontent.com/u/52130356?v=4?s=100" width="100px;" alt=""/><br /><sub><b>lmx-Hexagram</b></sub></a><br /><a href="https://github.com/grammyjs/grammY/commits?author=lmx-Hexagram" title="Documentation">📖</a></td>
|
|
179
192
|
</tr>
|
|
180
193
|
</table>
|
|
181
194
|
|
package/out/bot.js
CHANGED
|
@@ -301,7 +301,7 @@ you can circumvent this protection against memory leaks.`);
|
|
|
301
301
|
}
|
|
302
302
|
else
|
|
303
303
|
debugErr(error);
|
|
304
|
-
debugErr("Call to
|
|
304
|
+
debugErr("Call to getUpdates failed, retrying in 3 seconds ...");
|
|
305
305
|
await new Promise((r) => setTimeout(r, 3000));
|
|
306
306
|
};
|
|
307
307
|
while (this.pollingRunning) {
|
|
@@ -313,7 +313,10 @@ you can circumvent this protection against memory leaks.`);
|
|
|
313
313
|
updates = await this.api.getUpdates({ offset, limit, timeout, allowed_updates }, this.pollingAbortController.signal);
|
|
314
314
|
}
|
|
315
315
|
catch (error) {
|
|
316
|
-
|
|
316
|
+
if (this.pollingRunning)
|
|
317
|
+
await handleErr(error);
|
|
318
|
+
else
|
|
319
|
+
debug("Pending getUpdates request cancelled");
|
|
317
320
|
}
|
|
318
321
|
} while (updates === undefined && this.pollingRunning);
|
|
319
322
|
if (updates === undefined)
|
package/out/composer.js
CHANGED
|
@@ -299,7 +299,7 @@ class Composer {
|
|
|
299
299
|
const noAtCommands = new Set();
|
|
300
300
|
toArray(command).forEach((cmd) => {
|
|
301
301
|
if (cmd.startsWith("/")) {
|
|
302
|
-
throw new Error(`Do not include '/' when registering command handlers (use '${cmd.substr(
|
|
302
|
+
throw new Error(`Do not include '/' when registering command handlers (use '${cmd.substr(1)}' not '${cmd}')`);
|
|
303
303
|
}
|
|
304
304
|
const set = cmd.indexOf("@") === -1 ? noAtCommands : atCommands;
|
|
305
305
|
set.add(cmd);
|
package/out/context.d.ts
CHANGED
|
@@ -771,7 +771,7 @@ export declare class Context implements RenamedUpdate {
|
|
|
771
771
|
*
|
|
772
772
|
* **Official reference:** https://core.telegram.org/bots/api#sendinvoice
|
|
773
773
|
*/
|
|
774
|
-
replyWithInvoice(title: string, description: string, payload: string, provider_token: string, currency: string, prices: readonly LabeledPrice[], other?: Other<"sendInvoice", "title" | "description" | "payload" | "provider_token" | "
|
|
774
|
+
replyWithInvoice(title: string, description: string, payload: string, provider_token: string, currency: string, prices: readonly LabeledPrice[], other?: Other<"sendInvoice", "title" | "description" | "payload" | "provider_token" | "currency" | "prices">, signal?: AbortSignal): Promise<Message.InvoiceMessage>;
|
|
775
775
|
/**
|
|
776
776
|
* Context-aware alias for `api.answerShippingQuery`. If you sent an invoice requesting a shipping address and the parameter is_flexible was specified, the Bot API will send an Update with a shipping_query field to the bot. Use this method to reply to shipping queries. On success, True is returned.
|
|
777
777
|
*
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { InlineKeyboardButton, KeyboardButton, LoginUrl } from "../platform.node.js";
|
|
2
2
|
/**
|
|
3
|
-
* Use this class to simplify building a keyboard (something like this:
|
|
3
|
+
* Use this class to simplify building a custom keyboard (something like this:
|
|
4
4
|
* https://core.telegram.org/bots#keyboards).
|
|
5
5
|
*
|
|
6
6
|
* ```ts
|
|
7
|
-
* // Build a keyboard:
|
|
7
|
+
* // Build a custom keyboard:
|
|
8
8
|
* const keyboard = new Keyboard()
|
|
9
9
|
* .text('A').text('B').row()
|
|
10
10
|
* .text('C').text('D')
|
|
11
11
|
*
|
|
12
12
|
* // Now you can either pass it directly:
|
|
13
|
-
* ctx.reply('Here is your keyboard!', {
|
|
13
|
+
* ctx.reply('Here is your custom keyboard!', {
|
|
14
14
|
* reply_markup: keyboard
|
|
15
15
|
* })
|
|
16
16
|
* // Or if you need to specify more options in `reply_markup`:
|
|
17
|
-
* ctx.reply('Here is your keyboard!', {
|
|
17
|
+
* ctx.reply('Here is your custom keyboard!', {
|
|
18
18
|
* reply_markup: {
|
|
19
19
|
* keyboard: keyboard.build(), // note the `build` call
|
|
20
20
|
* one_time_keyboard: true,
|
|
@@ -23,12 +23,12 @@ import { InlineKeyboardButton, KeyboardButton, LoginUrl } from "../platform.node
|
|
|
23
23
|
* ```
|
|
24
24
|
*
|
|
25
25
|
* Be sure to check out the
|
|
26
|
-
* [documentation](https://grammy.dev/plugins/keyboard.html#keyboards) on
|
|
27
|
-
* keyboards in grammY.
|
|
26
|
+
* [documentation](https://grammy.dev/plugins/keyboard.html#custom-keyboards) on
|
|
27
|
+
* custom keyboards in grammY.
|
|
28
28
|
*/
|
|
29
29
|
export declare class Keyboard {
|
|
30
30
|
/**
|
|
31
|
-
* The nested array that holds the keyboard. It will be extended every time
|
|
31
|
+
* The nested array that holds the custom keyboard. It will be extended every time
|
|
32
32
|
* you call one of the provided methods.
|
|
33
33
|
*/
|
|
34
34
|
readonly keyboard: KeyboardButton[][];
|
|
@@ -82,8 +82,8 @@ export declare class Keyboard {
|
|
|
82
82
|
*/
|
|
83
83
|
requestPoll(text: string, type?: "quiz" | "regular"): this;
|
|
84
84
|
/**
|
|
85
|
-
* Return the resulting keyboard that was built. May be called in the
|
|
86
|
-
* necessary so you can specify more options in `reply_markup`.
|
|
85
|
+
* Return the resulting custom keyboard that was built. May be called in the
|
|
86
|
+
* end if necessary so you can specify more options in `reply_markup`.
|
|
87
87
|
*/
|
|
88
88
|
build(): KeyboardButton[][];
|
|
89
89
|
}
|
|
@@ -2,21 +2,21 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.InlineKeyboard = exports.Keyboard = void 0;
|
|
4
4
|
/**
|
|
5
|
-
* Use this class to simplify building a keyboard (something like this:
|
|
5
|
+
* Use this class to simplify building a custom keyboard (something like this:
|
|
6
6
|
* https://core.telegram.org/bots#keyboards).
|
|
7
7
|
*
|
|
8
8
|
* ```ts
|
|
9
|
-
* // Build a keyboard:
|
|
9
|
+
* // Build a custom keyboard:
|
|
10
10
|
* const keyboard = new Keyboard()
|
|
11
11
|
* .text('A').text('B').row()
|
|
12
12
|
* .text('C').text('D')
|
|
13
13
|
*
|
|
14
14
|
* // Now you can either pass it directly:
|
|
15
|
-
* ctx.reply('Here is your keyboard!', {
|
|
15
|
+
* ctx.reply('Here is your custom keyboard!', {
|
|
16
16
|
* reply_markup: keyboard
|
|
17
17
|
* })
|
|
18
18
|
* // Or if you need to specify more options in `reply_markup`:
|
|
19
|
-
* ctx.reply('Here is your keyboard!', {
|
|
19
|
+
* ctx.reply('Here is your custom keyboard!', {
|
|
20
20
|
* reply_markup: {
|
|
21
21
|
* keyboard: keyboard.build(), // note the `build` call
|
|
22
22
|
* one_time_keyboard: true,
|
|
@@ -25,13 +25,13 @@ exports.InlineKeyboard = exports.Keyboard = void 0;
|
|
|
25
25
|
* ```
|
|
26
26
|
*
|
|
27
27
|
* Be sure to check out the
|
|
28
|
-
* [documentation](https://grammy.dev/plugins/keyboard.html#keyboards) on
|
|
29
|
-
* keyboards in grammY.
|
|
28
|
+
* [documentation](https://grammy.dev/plugins/keyboard.html#custom-keyboards) on
|
|
29
|
+
* custom keyboards in grammY.
|
|
30
30
|
*/
|
|
31
31
|
class Keyboard {
|
|
32
32
|
constructor() {
|
|
33
33
|
/**
|
|
34
|
-
* The nested array that holds the keyboard. It will be extended every time
|
|
34
|
+
* The nested array that holds the custom keyboard. It will be extended every time
|
|
35
35
|
* you call one of the provided methods.
|
|
36
36
|
*/
|
|
37
37
|
Object.defineProperty(this, "keyboard", {
|
|
@@ -106,8 +106,8 @@ class Keyboard {
|
|
|
106
106
|
return this.add({ text, request_poll: { type } });
|
|
107
107
|
}
|
|
108
108
|
/**
|
|
109
|
-
* Return the resulting keyboard that was built. May be called in the
|
|
110
|
-
* necessary so you can specify more options in `reply_markup`.
|
|
109
|
+
* Return the resulting custom keyboard that was built. May be called in the
|
|
110
|
+
* end if necessary so you can specify more options in `reply_markup`.
|
|
111
111
|
*/
|
|
112
112
|
build() {
|
|
113
113
|
return this.keyboard;
|
|
@@ -218,7 +218,13 @@ export declare function lazySession<S, C extends Context>(options?: SessionOptio
|
|
|
218
218
|
*/
|
|
219
219
|
export declare class MemorySessionStorage<S> implements StorageAdapter<S> {
|
|
220
220
|
private readonly timeToLive;
|
|
221
|
-
|
|
221
|
+
/**
|
|
222
|
+
* Internally used `Map` instance that stores the session data
|
|
223
|
+
*/
|
|
224
|
+
protected readonly storage: Map<string, {
|
|
225
|
+
session: S;
|
|
226
|
+
expires?: number | undefined;
|
|
227
|
+
}>;
|
|
222
228
|
/**
|
|
223
229
|
* Constructs a new memory session storage with the given time to live. Note
|
|
224
230
|
* that this storage adapter will not store your data permanently.
|
|
@@ -227,6 +233,11 @@ export declare class MemorySessionStorage<S> implements StorageAdapter<S> {
|
|
|
227
233
|
*/
|
|
228
234
|
constructor(timeToLive?: number);
|
|
229
235
|
read(key: string): S | undefined;
|
|
236
|
+
/**
|
|
237
|
+
* Reads the values for all keys of the session storage, and returns them as
|
|
238
|
+
* an array.
|
|
239
|
+
*/
|
|
240
|
+
readAll(): S[];
|
|
230
241
|
write(key: string, value: S): void;
|
|
231
242
|
private addExpiryDate;
|
|
232
243
|
delete(key: string): void;
|
|
@@ -218,6 +218,9 @@ class MemorySessionStorage {
|
|
|
218
218
|
writable: true,
|
|
219
219
|
value: timeToLive
|
|
220
220
|
});
|
|
221
|
+
/**
|
|
222
|
+
* Internally used `Map` instance that stores the session data
|
|
223
|
+
*/
|
|
221
224
|
Object.defineProperty(this, "storage", {
|
|
222
225
|
enumerable: true,
|
|
223
226
|
configurable: true,
|
|
@@ -235,6 +238,16 @@ class MemorySessionStorage {
|
|
|
235
238
|
}
|
|
236
239
|
return value.session;
|
|
237
240
|
}
|
|
241
|
+
/**
|
|
242
|
+
* Reads the values for all keys of the session storage, and returns them as
|
|
243
|
+
* an array.
|
|
244
|
+
*/
|
|
245
|
+
readAll() {
|
|
246
|
+
return Array
|
|
247
|
+
.from(this.storage.keys())
|
|
248
|
+
.map((key) => this.read(key))
|
|
249
|
+
.filter((value) => value !== undefined);
|
|
250
|
+
}
|
|
238
251
|
write(key, value) {
|
|
239
252
|
this.storage.set(key, this.addExpiryDate(value));
|
|
240
253
|
}
|
package/out/core/api.d.ts
CHANGED
|
@@ -958,7 +958,7 @@ export declare class Api<R extends RawApi = RawApi> {
|
|
|
958
958
|
*
|
|
959
959
|
* **Official reference:** https://core.telegram.org/bots/api#sendinvoice
|
|
960
960
|
*/
|
|
961
|
-
sendInvoice(chat_id: number | string, title: string, description: string, payload: string, provider_token: string, currency: string, prices: readonly LabeledPrice[], other?: Other<R, "sendInvoice", "title" | "description" | "payload" | "provider_token" | "
|
|
961
|
+
sendInvoice(chat_id: number | string, title: string, description: string, payload: string, provider_token: string, currency: string, prices: readonly LabeledPrice[], other?: Other<R, "sendInvoice", "title" | "description" | "payload" | "provider_token" | "currency" | "prices">, signal?: AbortSignal): Promise<import("@grammyjs/types/message").Message.InvoiceMessage>;
|
|
962
962
|
/**
|
|
963
963
|
* If you sent an invoice requesting a shipping address and the parameter is_flexible was specified, the Bot API will send an Update with a shipping_query field to the bot. Use this method to reply to shipping queries. On success, True is returned.
|
|
964
964
|
*
|
package/out/core/payload.js
CHANGED
|
@@ -104,6 +104,8 @@ async function* payloadToMultipartItr(payload, boundary) {
|
|
|
104
104
|
const separator = enc.encode(`\r\n--${boundary}\r\n`);
|
|
105
105
|
let first = true;
|
|
106
106
|
for (const [key, value] of Object.entries(payload)) {
|
|
107
|
+
if (value == null)
|
|
108
|
+
continue;
|
|
107
109
|
if (!first)
|
|
108
110
|
yield separator;
|
|
109
111
|
yield valuePart(key, typeof value === "object" ? str(value) : value);
|
package/out/filter.js
CHANGED
|
@@ -127,9 +127,7 @@ Permitted values are: ${permitted.map((k) => `'${k}'`).join(", ")}.`;
|
|
|
127
127
|
const permitted = Object.keys(l2Obj);
|
|
128
128
|
return `Invalid L3 filter '${l3}' given in '${filter.join(":")}'. ${permitted.length === 0
|
|
129
129
|
? `No further filtering is possible after '${l1}:${l2}'.`
|
|
130
|
-
: `Permitted values are: ${permitted
|
|
131
|
-
.map((k) => `'${k}'`)
|
|
132
|
-
.join(", ")}.`}`;
|
|
130
|
+
: `Permitted values are: ${permitted.map((k) => `'${k}'`).join(", ")}.`}`;
|
|
133
131
|
}
|
|
134
132
|
if (n.length === 0)
|
|
135
133
|
return true;
|
package/out/platform.node.js
CHANGED
|
@@ -13,6 +13,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
13
13
|
exports.InputFile = exports.toRaw = exports.baseFetchConfig = exports.itrToStream = exports.debug = void 0;
|
|
14
14
|
const http_1 = require("http");
|
|
15
15
|
const https_1 = require("https");
|
|
16
|
+
const node_fetch_1 = require("node-fetch");
|
|
16
17
|
const path_1 = require("path");
|
|
17
18
|
const stream_1 = require("stream");
|
|
18
19
|
const url_1 = require("url");
|
|
@@ -126,7 +127,7 @@ class InputFile {
|
|
|
126
127
|
}
|
|
127
128
|
exports.InputFile = InputFile;
|
|
128
129
|
async function* fetchFile(url) {
|
|
129
|
-
const { body } = await (0,
|
|
130
|
+
const { body } = await (0, node_fetch_1.default)(url);
|
|
130
131
|
for await (const chunk of body) {
|
|
131
132
|
if (typeof chunk === "string") {
|
|
132
133
|
throw new Error(`Could not transfer file, received string data instead of bytes from '${url}'`);
|
|
@@ -134,4 +135,3 @@ async function* fetchFile(url) {
|
|
|
134
135
|
yield chunk;
|
|
135
136
|
}
|
|
136
137
|
}
|
|
137
|
-
const shim_node_js_1 = require("./shim.node.js");
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "grammy",
|
|
3
3
|
"description": "The Telegram Bot Framework.",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.6.0",
|
|
5
5
|
"author": "KnorpelSenf",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"engines": {
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"contribs": "all-contributors"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@grammyjs/types": "^2.
|
|
26
|
+
"@grammyjs/types": "^2.5.0",
|
|
27
27
|
"abort-controller": "^3.0.0",
|
|
28
28
|
"debug": "^4.3.3",
|
|
29
29
|
"node-fetch": "^2.6.5"
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"@types/node": "^12.20.36",
|
|
34
34
|
"@types/node-fetch": "^2.5.12",
|
|
35
35
|
"all-contributors-cli": "^6.20.0",
|
|
36
|
-
"deno2node": "^1.
|
|
36
|
+
"deno2node": "^1.1.0"
|
|
37
37
|
},
|
|
38
38
|
"files": [
|
|
39
39
|
"out/"
|