Skip to content

Commit

Permalink
Merge branch 'main' into v2
Browse files Browse the repository at this point in the history
  • Loading branch information
Steffen Trog committed Jan 20, 2025
2 parents fe4a4de + b0fd041 commit ef8b40b
Show file tree
Hide file tree
Showing 5 changed files with 144 additions and 6 deletions.
12 changes: 11 additions & 1 deletion .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@
"review",
"infra",
"platform",
"tool"
"tool",
"code"
]
},
{
Expand Down Expand Up @@ -1513,6 +1514,15 @@
"contributions": [
"doc"
]
},
{
"login": "ikelax",
"name": "ikelax",
"avatar_url": "https://avatars.githubusercontent.com/u/163678144?v=4",
"profile": "https://github.com/ikelax",
"contributions": [
"doc"
]
}
]
}
4 changes: 1 addition & 3 deletions .github/workflows/deno.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ name: grammY

on:
push:
branches: [main]
pull_request:
branches: [main]
branches: ["*"]

jobs:
format-and-lint:
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<!-- deno-fmt-ignore-start -->

[![Bot API](https://img.shields.io/badge/Bot%20API-8.1-blue?logo=telegram&style=flat&labelColor=000&color=3b82f6)](https://core.telegram.org/bots/api)
[![Bot API](https://img.shields.io/badge/Bot%20API-8.2-blue?logo=telegram&style=flat&labelColor=000&color=3b82f6)](https://core.telegram.org/bots/api)
[![Deno](https://shield.deno.dev/x/grammy)](https://deno.land/x/grammy)
[![npm](https://img.shields.io/npm/v/grammy?logo=npm&style=flat&labelColor=000&color=3b82f6)](https://www.npmjs.org/package/grammy)
[![All Contributors](https://img.shields.io/github/all-contributors/grammyjs/grammy?style=flat&labelColor=000&color=3b82f6)](#contributors-)
Expand Down Expand Up @@ -144,7 +144,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<tr>
<td align="center" valign="top" width="11.11%"><a href="https://github.com/KnorpelSenf"><img src="https://avatars.githubusercontent.com/u/12952387?v=4?s=100" width="100px;" alt="KnorpelSenf"/><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> <a href="#audio-KnorpelSenf" title="Audio">🔊</a> <a href="#a11y-KnorpelSenf" title="Accessibility">️️️️♿️</a> <a href="#talk-KnorpelSenf" title="Talks">📢</a></td>
<td align="center" valign="top" width="11.11%"><a href="https://github.com/HeeroML"><img src="https://avatars.githubusercontent.com/u/42873000?v=4?s=100" width="100px;" alt="Heero"/><br /><sub><b>Heero</b></sub></a><br /><a href="#plugin-HeeroML" title="Plugin/utility libraries">🔌</a> <a href="#userTesting-HeeroML" title="User Testing">📓</a> <a href="#example-HeeroML" title="Examples">💡</a> <a href="https://github.com/grammyjs/grammY/commits?author=HeeroML" title="Documentation">📖</a> <a href="https://github.com/grammyjs/grammY/pulls?q=is%3Apr+reviewed-by%3AHeeroML" title="Reviewed Pull Requests">👀</a> <a href="https://github.com/grammyjs/grammY/commits?author=HeeroML" title="Code">💻</a> <a href="#ideas-HeeroML" title="Ideas, Planning, & Feedback">🤔</a></td>
<td align="center" valign="top" width="11.11%"><a href="https://github.com/wojpawlik"><img src="https://avatars.githubusercontent.com/u/23058303?v=4?s=100" width="100px;" alt="Wojciech Pawlik"/><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>
<td align="center" valign="top" width="11.11%"><a href="https://github.com/wojpawlik"><img src="https://avatars.githubusercontent.com/u/23058303?v=4?s=100" width="100px;" alt="Wojciech Pawlik"/><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> <a href="https://github.com/grammyjs/grammY/commits?author=wojpawlik" title="Code">💻</a></td>
<td align="center" valign="top" width="11.11%"><a href="https://github.com/MegaITA"><img src="https://avatars.githubusercontent.com/u/32493080?v=4?s=100" width="100px;" alt="Alessandro Bertozzi"/><br /><sub><b>Alessandro Bertozzi</b></sub></a><br /><a href="https://github.com/grammyjs/grammY/commits?author=MegaITA" title="Documentation">📖</a></td>
<td align="center" valign="top" width="11.11%"><a href="https://trgwii.no/"><img src="https://avatars.githubusercontent.com/u/11262022?v=4?s=100" width="100px;" alt="trgwii"/><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>
<td align="center" valign="top" width="11.11%"><a href="https://github.com/KnightNiwrem"><img src="https://avatars.githubusercontent.com/u/9781814?v=4?s=100" width="100px;" alt="KnightNiwrem"/><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>
Expand Down Expand Up @@ -321,6 +321,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<td align="center" valign="top" width="11.11%"><a href="https://www.vorant94.io/"><img src="https://avatars.githubusercontent.com/u/9719319?v=4?s=100" width="100px;" alt="Mordechai Dror"/><br /><sub><b>Mordechai Dror</b></sub></a><br /><a href="https://github.com/grammyjs/grammY/pulls?q=is%3Apr+reviewed-by%3Avorant94" title="Reviewed Pull Requests">👀</a></td>
<td align="center" valign="top" width="11.11%"><a href="https://github.com/mahovich"><img src="https://avatars.githubusercontent.com/u/2377626?v=4?s=100" width="100px;" alt="mahovich"/><br /><sub><b>mahovich</b></sub></a><br /><a href="https://github.com/grammyjs/grammY/commits?author=mahovich" title="Documentation">📖</a></td>
<td align="center" valign="top" width="11.11%"><a href="https://github.com/Hth4nh"><img src="https://avatars.githubusercontent.com/u/63627651?v=4?s=100" width="100px;" alt="Thành Hoàng Trần"/><br /><sub><b>Thành Hoàng Trần</b></sub></a><br /><a href="https://github.com/grammyjs/grammY/commits?author=Hth4nh" title="Documentation">📖</a></td>
<td align="center" valign="top" width="11.11%"><a href="https://github.com/ikelax"><img src="https://avatars.githubusercontent.com/u/163678144?v=4?s=100" width="100px;" alt="ikelax"/><br /><sub><b>ikelax</b></sub></a><br /><a href="https://github.com/grammyjs/grammY/commits?author=ikelax" title="Documentation">📖</a></td>
</tr>
</tbody>
</table>
Expand Down
68 changes: 68 additions & 0 deletions src/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3092,6 +3092,74 @@ export class Context implements RenamedUpdate {
);
}

/**
* Context-aware alias for `api.verifyUser`. Verifies a user on behalf of the organization which is represented by the bot. Returns True on success.
*
* @param other Optional remaining parameters, confer the official reference below
* @param signal Optional `AbortSignal` to cancel the request
*
* **Official reference:** https://core.telegram.org/bots/api#verifyuser
*/
verifyUser(
other?: Other<"verifyUser">,
signal?: AbortSignal,
) {
return this.api.verifyUser(
orThrow(this.from, "verifyUser").id,
other,
signal,
);
}

/**
* Context-aware alias for `api.verifyChat`. Verifies a chat on behalf of the organization which is represented by the bot. Returns True on success.
*
* @param other Optional remaining parameters, confer the official reference below
* @param signal Optional `AbortSignal` to cancel the request
*
* **Official reference:** https://core.telegram.org/bots/api#verifychat
*/
verifyChat(
other?: Other<"verifyChat">,
signal?: AbortSignal,
) {
return this.api.verifyChat(
orThrow(this.chatId, "verifyChat"),
other,
signal,
);
}

/**
* Context-aware alias for `api.removeUserVerification`. Removes verification from a user who is currently verified on behalf of the organization represented by the bot. Returns True on success.
*
* @param signal Optional `AbortSignal` to cancel the request
*
* **Official reference:** https://core.telegram.org/bots/api#removeuserverification
*/
removeUserVerification(signal?: AbortSignal) {
return this.api.removeUserVerification(
orThrow(this.from, "removeUserVerification").id,
signal,
);
}

/**
* Context-aware alias for `api.removeChatVerification`. Removes verification from a chat that is currently verified on behalf of the organization represented by the bot. Returns True on success.
*
* @param signal Optional `AbortSignal` to cancel the request
*
* **Official reference:** https://core.telegram.org/bots/api#removechatverification
*/
removeChatVerification(
signal?: AbortSignal,
) {
return this.api.removeChatVerification(
orThrow(this.chatId, "removeChatVerification"),
signal,
);
}

/**
* Context-aware alias for `api.setPassportDataErrors`. Informs a user that some of the Telegram Passport elements they provided contains errors. The user will not be able to re-submit their Passport to you until the errors are fixed (the contents of the field for which you returned the error must change). Returns True on success.
*
Expand Down
61 changes: 61 additions & 0 deletions src/core/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2749,6 +2749,67 @@ export class Api<R extends RawApi = RawApi> {
);
}

/**
* Verifies a user on behalf of the organization which is represented by the bot. Returns True on success.
*
* @param user_id Unique identifier of the target user
* @param other Optional remaining parameters, confer the official reference below
* @param signal Optional `AbortSignal` to cancel the request
*
* **Official reference:** https://core.telegram.org/bots/api#verifyuser
*/
verifyUser(
user_id: number,
other?: Other<R, "verifyUser">,
signal?: AbortSignal,
) {
return this.raw.verifyUser({ user_id, ...other }, signal);
}

/**
* Verifies a chat on behalf of the organization which is represented by the bot. Returns True on success.
*
* @param chat_id Unique identifier for the target chat or username of the target channel (in the format @channelusername)
* @param other Optional remaining parameters, confer the official reference below
* @param signal Optional `AbortSignal` to cancel the request
*
* **Official reference:** https://core.telegram.org/bots/api#verifychat
*/
verifyChat(
chat_id: number | string,
other?: Other<R, "verifyChat">,
signal?: AbortSignal,
) {
return this.raw.verifyChat({ chat_id, ...other }, signal);
}

/**
* Removes verification from a user who is currently verified on behalf of the organization represented by the bot. Returns True on success.
*
* @param user_id Unique identifier of the target user
* @param signal Optional `AbortSignal` to cancel the request
*
* **Official reference:** https://core.telegram.org/bots/api#removeuserverification
*/
removeUserVerification(user_id: number, signal?: AbortSignal) {
return this.raw.removeUserVerification({ user_id }, signal);
}

/**
* Removes verification from a chat that is currently verified on behalf of the organization represented by the bot. Returns True on success.
*
* @param chat_id Unique identifier for the target chat or username of the target channel (in the format @channelusername)
* @param signal Optional `AbortSignal` to cancel the request
*
* **Official reference:** https://core.telegram.org/bots/api#removechatverification
*/
removeChatVerification(
chat_id: number | string,
signal?: AbortSignal,
) {
return this.raw.removeChatVerification({ chat_id }, signal);
}

/**
* Informs a user that some of the Telegram Passport elements they provided contains errors. The user will not be able to re-submit their Passport to you until the errors are fixed (the contents of the field for which you returned the error must change). Returns True on success.
*
Expand Down

0 comments on commit ef8b40b

Please sign in to comment.