Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
955b9fa
Fix(LanguageCode): user.language is not compatible with ISO 639-1
Sempai-07 Apr 11, 2026
371f2ee
Bump @telegram.ts/types version
Sempai-07 Apr 11, 2026
aa97e17
Update(User): removed the check due to the introduction of (Bot-to-Bot)
Sempai-07 Apr 11, 2026
00268d1
Fix(ManagerCached): fullInfo flag will be fetched instead of being ta…
Sempai-07 Apr 17, 2026
9a63d3e
Support api 9.4
Sempai-07 Apr 17, 2026
cf48906
Fix(ready): ready event no longer returns nullable ClientUser
Sempai-07 Apr 17, 2026
2408a4b
Support api 9.5
Sempai-07 Apr 18, 2026
0f710dd
Fix(typings): return type setChatMemberTag
Sempai-07 Apr 18, 2026
5c98de3
Support api 9.6
Sempai-07 May 2, 2026
07de1b9
Fix(KeyboardButtonRequestUsers): correct fields user_is_premium
Sempai-07 May 6, 2026
b01af28
Refactor(KeyboardBuilder): equals deep property comparison
Sempai-07 May 6, 2026
87751df
Fix(sendPoll): description_parse_mode fix type for field
Sempai-07 May 6, 2026
c7e6ef7
savePreparedKeyboardButton has been added as an additional method to …
Sempai-07 May 6, 2026
f6c50ef
Refactor(types): remove private members from typings
Sempai-07 May 7, 2026
e838533
Refactor(Collector): normalize lastCollectedAt to Date | null
Sempai-07 May 7, 2026
01f459b
Refactor(permissions): deduplicate code with base PermissionManager c…
Sempai-07 May 7, 2026
79b0a25
Typing(PermissionManager): export PermissionManager class and its types
Sempai-07 May 7, 2026
d659cfa
Update CHANGELOG.md
Sempai-07 May 7, 2026
f3e8a86
Release 4.14.0
Sempai-07 May 7, 2026
08e106c
Update CHANGELOG.md
Sempai-07 May 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 39 additions & 13 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,32 @@
# Changelog

# **4.14.0 - (2026-06-06)**

## **Updates**

- Support api `9.4`, `9.5`, `9.6` ([00268d1](https://github.com/telegramsjs/Telegramsjs/commit/00268d1a895644a8be654e86127837b6de6d0e36), [cf48906](https://github.com/telegramsjs/Telegramsjs/commit/cf4890611978f04aa28f0f18a30d78cfb910bace), [0f710dd](https://github.com/telegramsjs/Telegramsjs/commit/0f710dd7262dafb3ccbb25ebd2c2e5e0ec4f84bb))
- **User:** removed the check due to the introduction of (Bot-to-Bot) ([371f2ee](https://github.com/telegramsjs/Telegramsjs/commit/371f2ee0ea5fbabae9de89cb57ddf67085802cfc))

## **Bug Fixes**

- **LanguageCode:** `user.language` is not compatible with ISO 639-1 ([c19f0ee](https://github.com/telegramsjs/Telegramsjs/commit/c19f0eeec737cc7a1d156177bd28efad395901c5))
- **ManagerCached:** `fullInfo` flag will be fetched instead of being taken from the cache of the regular `User` object ([aa97e17](https://github.com/telegramsjs/Telegramsjs/commit/aa97e171e52dc2c084f19b38c70bd802bf032334))
- **Ready:** ready event no longer returns nullable `ClientUser` ([9a63d3e](https://github.com/telegramsjs/Telegramsjs/commit/9a63d3e1694e0b8d7e4062790380a8bff4b30273))

## **Features**

- **PermissionManager**: deduplicate code with base `PermissionManager` class ([e838533](https://github.com/telegramsjs/Telegramsjs/commit/e838533bf983b587b5eb2ca51deee8c37a148aea), [01f459b](https://github.com/telegramsjs/Telegramsjs/commit/01f459b0533add328eae8a5ea7e9e1b543e310de))
- **ClientUser:** replace plain fields with a `ClientCapabilities` class ([0f710dd](https://github.com/telegramsjs/Telegramsjs/commit/0f710dd7262dafb3ccbb25ebd2c2e5e0ec4f84bb))
- **KeyboardBuilder:** `equals` deep property comparison ([07de1b9](https://github.com/telegramsjs/Telegramsjs/commit/07de1b9079c877c6c862020b9b4c5323a8b21d33))

## **Typings**

- **Remove private members from typings** ([c7e6ef7](https://github.com/telegramsjs/Telegramsjs/commit/c7e6ef742613f206b7ad364e8473ad9d3f49981b))
- **Collector:** normalize `lastCollectedAt` to `Date | null` ([f6c50ef](https://github.com/telegramsjs/Telegramsjs/commit/f6c50ef078431bda17cade31095c83fefdf408aa))
- **KeyboardButtonRequestUsers:** correct fields `user_is_premium` ([5c98de3](https://github.com/telegramsjs/Telegramsjs/commit/5c98de38373afebf7e299e724d4e7ff42270c86a))

---

# **4.13.1 - (2026-01-14)**

## **Bug Fixes**
Expand Down Expand Up @@ -27,11 +54,11 @@

## **Bug Fixes**

- **MediaData:** parsing inside array fields cover and thumbnail ([3a3bb6a](https://github.com/telegramsjs/Telegramsjs/commit/3a3bb6ab470191f5afbde0c0d3212de896fec3c2))
- **MediaData:** parsing inside array fields `cover` and `thumbnail` ([3a3bb6a](https://github.com/telegramsjs/Telegramsjs/commit/3a3bb6ab470191f5afbde0c0d3212de896fec3c2))

## **Refactor**

- **Array:** use Collection instead of Array ([8c36298](https://github.com/telegramsjs/Telegramsjs/commit/8c36298080442b93cd89941a0e591f2d377f601f))
- **Array:** use `Collection` instead of Array ([8c36298](https://github.com/telegramsjs/Telegramsjs/commit/8c36298080442b93cd89941a0e591f2d377f601f))
- **MessageEntities:** add `languageCode` union type ([457959c](https://github.com/telegramsjs/Telegramsjs/commit/457959c6ce531ca4318fb4cf0213897e8bcf2e61))
- **Symbol.iterator:** refactored to a unified style ([846b90d](https://github.com/telegramsjs/Telegramsjs/commit/846b90df8de01bbc2ad4b1ac2c4bc3b6f8d1f459))

Expand All @@ -53,14 +80,14 @@

## **Features**

- **TelegramClient:** resolve login timing issue with async ready handling ([39726ee](https://github.com/telegramsjs/Telegramsjs/commit/39726ee189b1575e0200763c0245179dd3ec5d62))
- **TelegramClient:** resolve `login` timing issue with async ready handling ([39726ee](https://github.com/telegramsjs/Telegramsjs/commit/39726ee189b1575e0200763c0245179dd3ec5d62))
- **BaseManager:** allow fetch via resolved chat object ([fe95849](https://github.com/telegramsjs/Telegramsjs/commit/fe95849120b89c39d37050c1db4e747552a5bbb4))
- **BaseManager:** fetches multiple users or chats at once ([19180de](https://github.com/telegramsjs/Telegramsjs/commit/19180de54a9564417f9be5448b819bdcd69f5ce9))

## **Typings**

- **ChatManager:** correct name parameters ([a874d79](https://github.com/telegramsjs/Telegramsjs/commit/a874d7942194c44229856a8fc4111245f0113c93))
- **BaseManager:** add UserResolvable and ChatResolvable typings ([49a57ad](https://github.com/telegramsjs/Telegramsjs/commit/49a57ad6cdb550616ef60de39e49b03b5008c69b))
- **BaseManager:** add `UserResolvable` and `ChatResolvable` typings ([49a57ad](https://github.com/telegramsjs/Telegramsjs/commit/49a57ad6cdb550616ef60de39e49b03b5008c69b))

---

Expand Down Expand Up @@ -97,7 +124,6 @@
- **WorkerClient:** type in the name `worket` ([5ff4122](https://github.com/telegramsjs/Telegramsjs/commit/5ff4122d6c98ed5b5e3d2385916276aa79f3f7b1))
- **WebhookClient:** async `close` now waits for server shutdown ([e2605d8](https://github.com/telegramsjs/Telegramsjs/commit/e2605d8717a3d039b818d308d42a2f642dbaf581))


## **Typings**

- Fix build `#private` fields ([c1dcc8d](https://github.com/telegramsjs/Telegramsjs/commit/c1dcc8d92fd3269196a3ec516d3e868f9e10b0bb))
Expand Down Expand Up @@ -132,7 +158,7 @@

## **Bug Fixes**

- **tsconfig.test.json:** esModuleInterop enable ([0cb33c6](https://github.com/telegramsjs/Telegramsjs/commit/0cb33c65467b96c5a851e80435c68c309c6e1ff6))
- **tsconfig.test.json:** `esModuleInterop` enable ([0cb33c6](https://github.com/telegramsjs/Telegramsjs/commit/0cb33c65467b96c5a851e80435c68c309c6e1ff6))

## **Updates**

Expand Down Expand Up @@ -176,7 +202,7 @@

## **Updates**

- Support for API 8.1 ([8b2bb08](https://github.com/telegramsjs/Telegramsjs/commit/8b2bb080deebaf2da11cbdb88e7031c2c254d4eb)).
- **Support for API 8.1** ([8b2bb08](https://github.com/telegramsjs/Telegramsjs/commit/8b2bb080deebaf2da11cbdb88e7031c2c254d4eb)).
- `removeComments` parameter (to reduce package size) ([430f34d](https://github.com/telegramsjs/Telegramsjs/commit/430f34d226144258a72b4ce495a56222d189b602)).

---
Expand All @@ -186,7 +212,7 @@
## **Bug Fixes**

- **InputFile:** fixed field names and argument validation ([f05bf32](https://github.com/telegramsjs/Telegramsjs/commit/f05bf32f1093c9c5fa18e169a21adea279918abb)).
- **WebhookClient:** resolved duplicate triggering of the "ready" event ([a820d97](https://github.com/telegramsjs/Telegramsjs/commit/a820d975a5cadf7a74c3df77677b1d372b382f8f)).
- **WebhookClient:** resolved duplicate triggering of the `ready` event ([a820d97](https://github.com/telegramsjs/Telegramsjs/commit/a820d975a5cadf7a74c3df77677b1d372b382f8f)).
- **getStarTransactions:** typings returned value `StarTransactions` ([165eb5c](https://github.com/telegramsjs/Telegramsjs/commit/165eb5cc975c9f7202cfeb24ee9315bc24d69ae2)).
- **InlineKeyboardBuilder:** at least one optional field is required ([fc38ccb](https://github.com/telegramsjs/Telegramsjs/commit/fc38ccbcd34362f24cf66046b9c728f2e01ea97b)).
- **Version:** missing type annotations ([d48f78f](https://github.com/telegramsjs/Telegramsjs/commit/d48f78fd4a80cb056c0bad1ee0014447b37eae1c)).
Expand All @@ -210,15 +236,15 @@
- **Array:** converted some fields to `Collections` for improved data handling of large arrays ([9fc6037](https://github.com/telegramsjs/Telegramsjs/commit/9fc6037dad2233978ba71ab132a0a6800a6b9c43)).
- **Collection:** introduced `ReadonlyCollection` to prevent mutation of essential data ([73a76f4](https://github.com/telegramsjs/Telegramsjs/commit/73a76f41271deae303e5cd53bc2bbb1105950bd2)).
- **TelegramClient:** `user` field now supports `null` values ([cb49cf3](https://github.com/telegramsjs/Telegramsjs/commit/cb49cf37f9b1919dba66d3562baf95acd1b9b4d4)).
- **disconnect:** now triggers even when using the error event ([86186ce](https://github.com/telegramsjs/Telegramsjs/commit/86186ce42288f7c317b186a483f7118518159692)).
- **disconnect:** now triggers even when using the `error` event ([86186ce](https://github.com/telegramsjs/Telegramsjs/commit/86186ce42288f7c317b186a483f7118518159692)).
- **errorHandler:** update error handling logic ([f47e03b](https://github.com/telegramsjs/Telegramsjs/commit/f47e03bb2f12d78c8bc0a0119aca4fb893fac5ea)).
- **Fetch data**: data retrieval logic ([3b978ee](https://github.com/telegramsjs/Telegramsjs/commit/3b978eed6a528d17743f584ef7688f30ad36cd1d)).
- **Prefix names:** all methods for struct classes prefixed with 'get' have been changed to 'fetch' ([5619dd1](https://github.com/telegramsjs/Telegramsjs/commit/5619dd1b87370ec6a21803e28b0ed2e1abe6ab8f)).
- **Prefix names:** all methods for struct classes prefixed with `get` have been changed to `fetch` ([5619dd1](https://github.com/telegramsjs/Telegramsjs/commit/5619dd1b87370ec6a21803e28b0ed2e1abe6ab8f)).

## **Updates**

- Support for API 8.0 ([cec95aa](https://github.com/telegramsjs/Telegramsjs/commit/cec95aad043575dbebb653a2262558e0f8aa5283)).
- **InputFile:** fix handling for download parameters to use class instances ([f32fb75](https://github.com/telegramsjs/Telegramsjs/commit/f32fb755fd564f3b224a190d8a9602a1384bd2d7)).
- **Support for API 8.0** ([cec95aa](https://github.com/telegramsjs/Telegramsjs/commit/cec95aad043575dbebb653a2262558e0f8aa5283)).
- **InputFile:** fix handling for **download** parameters to use class instances ([f32fb75](https://github.com/telegramsjs/Telegramsjs/commit/f32fb755fd564f3b224a190d8a9602a1384bd2d7)).
- **InputFile:** add fallback to fetch if `filePath` is missing ([1ac66f2](https://github.com/telegramsjs/Telegramsjs/commit/1ac66f23bf65d47d8941d5d8d8d525f79f7355ab)).
- Bump version of `@telegram.ts/types` to `1.18.2` ([04d68de](https://github.com/telegramsjs/Telegramsjs/commit/04d68de607fcf3a5544bc3f705b9d83df039df18)).

Expand Down Expand Up @@ -252,7 +278,7 @@

## **Refactor**

- Support api 7.11 ([7169314](https://github.com/telegramsjs/Telegramsjs/commit/716931437f15b5a630f6c8c162d4375e3b58bf8d))
- **Support api 7.11** ([7169314](https://github.com/telegramsjs/Telegramsjs/commit/716931437f15b5a630f6c8c162d4375e3b58bf8d))
- Convert individual parameters to object structure ([a772144](https://github.com/telegramsjs/Telegramsjs/commit/a7721447d7450bb20eba9266944731b62f35d26b))
- `Symbol.iterator` to some classes ([e7f0193](https://github.com/telegramsjs/Telegramsjs/commit/e7f01933f06897d7f98ff4f51e98424dfdf406d5))
- Add `languageCode` type ([9d8c19f](https://github.com/telegramsjs/Telegramsjs/commit/9d8c19f7351a2b0ac00d94c99565365cff9a23f7))
Expand Down
66 changes: 57 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<h1>Telegramsjs</h1><br>
<img src="https://raw.githubusercontent.com/Sempai-07/Telegramsjs/main/docs/avatar.png"><br>

[![Bot API](https://img.shields.io/badge/Bot%20API-v.9.3-00aced.svg?style=flat-square&logo=telegram)](https://core.telegram.org/bots/api)
[![Bot API](https://img.shields.io/badge/Bot%20API-v.9.6-00aced.svg?style=flat-square&logo=telegram)](https://core.telegram.org/bots/api)
[![NPM Version](https://img.shields.io/npm/v/telegramsjs.svg?maxAge=3600)](https://www.npmjs.com/package/telegramsjs)
[![NPM Downloads](https://img.shields.io/npm/dt/telegramsjs.svg?maxAge=3600)](https://www.npmjs.com/package/telegramsjs)

Expand Down Expand Up @@ -50,9 +50,17 @@ Afterwards we can create a quite simple example bot:

```js
// ECMAscript/TypeScript
import { TelegramClient } from "telegramsjs";
import {
TelegramClient,
InlineKeyboardBuilder,
MarkupStyles,
} from "telegramsjs";
// CommonJS
const { TelegramClient } = require("telegramsjs");
const {
TelegramClient,
InlineKeyboardBuilder,
MarkupStyles,
} = require("telegramsjs");

const client = new TelegramClient("TELEGRAM_BOT_TOKEN");

Expand All @@ -64,15 +72,55 @@ client.on("ready", async ({ user }) => {
},
]);

if (user.capabilities.allow("joinGroups")) {
console.log("The bot has permission to be added to other groups. 🔓");
}

console.log(`Bot @${user.username} is the ready status!`);

});

client.on("message", async (message) => {
if (message.content === "/start" && message.author) {
await message.reply(
`Hello ${message.author.username ? `@${message.author.username}` : message.author.firstName}!`,
);
return;
client.on("message", async (msg) => {
if (!msg.content) return;

if (msg.content === "/menu" || msg.content === "/start") {
const menu = new InlineKeyboardBuilder()
.text("Pay", "menu_pay", {
style: MarkupStyles.Green,
icon: "5463122435425448565",
})
.text("Rules", "menu_rules", {
style: MarkupStyles.Danger,
icon: "5465154440287757794",
})
.row()
.text("Home", "menu_home", {
style: MarkupStyles.Primary,
icon: "5253997076169115797",
});

await msg.chat.send("Panel for payment", {
replyMarkup: menu,
});
}

if (msg.content.startsWith("/tag")) {
if (!msg.chat.isGroup()) {
return msg.reply(`Changing your nickname is only available in groups.`);
}

const [, newTag] = msg.content.split(" ");

try {
await msg.member.setTag(newTag);
return msg.chat.send(
`${msg.author.firstName} Your custom tag has been changed to: ${newTag}`,
);
} catch (err) {
condole.log(err);

return msg.chat.send("Error when changing custom tag.");
}
}
});

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "telegramsjs",
"description": "A powerful library for interacting with the Telegram Bot API",
"version": "4.13.1",
"version": "4.14.0",
"main": "./dist/src/index.js",
"types": "./typings/index.d.ts",
"scripts": {
Expand Down Expand Up @@ -53,7 +53,7 @@
},
"homepage": "https://docs-telegramsjs.vercel.app/",
"devDependencies": {
"@telegram.ts/types": "^1.25.1",
"@telegram.ts/types": "^1.28.1",
"@types/node": "^18.19.130",
"@types/node-fetch": "^2.6.11",
"@types/safe-compare": "^1.1.2",
Expand Down
Loading
Loading