Skip to content

Commit

Permalink
feat: update to Telegram Bot API 7.5 🔥🔥🔥
Browse files Browse the repository at this point in the history
  • Loading branch information
kravetsone committed Jun 18, 2024
1 parent 1638b59 commit 99eb970
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "gramio",
"version": "0.0.39",
"type": "commonjs",
"version": "0.0.40",
"description": "Powerful Telegram Bot API framework",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand All @@ -27,7 +28,7 @@
"license": "ISC",
"devDependencies": {
"@biomejs/biome": "1.7.3",
"@types/node": "^20.12.12",
"@types/node": "^20.14.5",
"typescript": "^5.4.5"
},
"dependencies": {
Expand All @@ -36,10 +37,10 @@
"@gramio/files": "^0.0.8",
"@gramio/format": "^0.1.3",
"@gramio/keyboards": "^0.3.3",
"@gramio/types": "^7.4.1",
"inspectable": "^3.0.1",
"@gramio/types": "^7.5.0",
"inspectable": "^3.0.2",
"middleware-io": "^2.8.1",
"undici": "^6.18.1"
"undici": "^6.19.2"
},
"files": [
"dist"
Expand Down
3 changes: 3 additions & 0 deletions src/bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ export class Bot<
new Plugin("@gramio/format").preRequest((context) => {
if (!context.params) return context;

// @ts-expect-error
const formattable = FormattableMap[context.method];
// @ts-ignore add AnyTelegramMethod to @gramio/format
if (formattable) context.params = formattable(context.params);
Expand Down Expand Up @@ -223,7 +224,9 @@ export class Bot<
// biome-ignore lint/style/noParameterAssign: mutate params
params = context.params;

// @ts-expect-error
if (params && isMediaUpload(method, params)) {
// @ts-expect-error
const formData = await convertJsonToFormData(method, params);

reqOptions.body = formData as FormData;
Expand Down

0 comments on commit 99eb970

Please sign in to comment.