Skip to content

Commit

Permalink
feat: add support to Telegram Bot API 7.6
Browse files Browse the repository at this point in the history
  • Loading branch information
kravetsone committed Jul 1, 2024
1 parent 4709989 commit 84f5cda
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 33 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@

## Please see [Documentation](https://gramio.dev/files/overview.html) and [API Reference](https://jsr.io/@gramio/files/doc)

Currently, support Telegram Bot API v7.3+
Currently, support Telegram Bot API v7.6+
Binary file modified bun.lockb
Binary file not shown.
64 changes: 32 additions & 32 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
{
"name": "@gramio/files",
"main": "./dist/index.js",
"version": "0.0.8",
"type": "commonjs",
"description": "Set of utils for work with files and Telegram Bot API",
"keywords": [
"gramio",
"telegram",
"file",
"files",
"upload"
],
"scripts": {
"generate": "bun scripts/generate.ts",
"prepublishOnly": "tsc",
"lint": "bunx @biomejs/biome check ./src",
"lint:fix": "bun lint --apply",
"jsr": "bun scripts/release-jsr.ts"
},
"devDependencies": {
"@biomejs/biome": "1.7.3",
"@types/bun": "^1.1.1",
"@types/node": "^20.12.11",
"prettier": "^3.2.5",
"typescript": "^5.4.5"
},
"dependencies": {
"@gramio/types": "^7.3.4"
},
"files": [
"dist"
]
"name": "@gramio/files",
"main": "./dist/index.js",
"version": "0.0.8",
"type": "commonjs",
"description": "Set of utils for work with files and Telegram Bot API",
"keywords": [
"gramio",
"telegram",
"file",
"files",
"upload"
],
"scripts": {
"generate": "bun scripts/generate.ts",
"prepublishOnly": "tsc",
"lint": "bunx @biomejs/biome check ./src",
"lint:fix": "bun lint --apply",
"jsr": "bun scripts/release-jsr.ts"
},
"devDependencies": {
"@biomejs/biome": "1.7.3",
"@types/bun": "^1.1.6",
"@types/node": "^20.14.9",
"prettier": "^3.3.2",
"typescript": "^5.5.2"
},
"dependencies": {
"@gramio/types": "^7.6.0"
},
"files": [
"dist"
]
}
10 changes: 10 additions & 0 deletions src/media-methods-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,16 @@ export const MEDIA_METHODS: MethodsWithMediaUpload = {
(params) => isFile(params.video_note) || isFile(params.thumbnail),
null,
],
sendPaidMedia: [
(params) => params.media.some((x) => "media" in x && isFile(x.media)),
[
{
name: "media",
property: "media",
type: "array",
},
],
],
sendMediaGroup: [
(params) =>
params.media.some((x) => "media" in x && isFile(x.media)) ||
Expand Down

0 comments on commit 84f5cda

Please sign in to comment.