telegram-bot-api-types
Advanced tools
Comparing version 7.9.3 to 7.9.4
{ | ||
"name": "telegram-bot-api-types", | ||
"version": "7.9.3", | ||
"version": "7.9.4", | ||
"description": "Telegram Bot API types", | ||
@@ -5,0 +5,0 @@ "repository": "git@github.com:TBXark/telegram-bot-api-types.git", |
# @types/telegram-bot-api | ||
This is a `d.ts` file for Telegram Bot API. It is based on the official [Telegram Bot API](https://core.telegram.org/bots/api) documentation. | ||
A 0KB Telegram Bot API SDK that only includes type definition files. It can be used to conveniently develop Telegram Bots in TypeScript. | ||
This is a `d.ts` file for Telegram Bot API. It is based on the official [Telegram Bot API](https://core.telegram.org/bots/api) documentation. | ||
![](./preview.jpg) | ||
### Installation | ||
@@ -14,5 +18,7 @@ | ||
You can use any HTTP request library you want to encapsulate your API client. Here is a simple example: | ||
```typescript | ||
import type { GetFileRequest, GetMeRequest, SendPhotoRequest, BotMethod } from "."; | ||
import type { GetFileRequest, GetMeRequest, SendPhotoRequest, BotMethod, AllBotMethods } from "."; | ||
@@ -72,3 +78,4 @@ class APIClientBase { | ||
type APIClient = APIClientBase & GetFileRequest & SendPhotoRequest & GetMeRequest; | ||
// type APIClient = APIClientBase & GetFileRequest & SendPhotoRequest & GetMeRequest; // You can use this type if you want to implement the methods one by one. | ||
type APIClient = APIClientBase & AllBotMethods // Or you can use this type to include all methods at once. | ||
@@ -98,4 +105,9 @@ export function createAPIClient(token: string): APIClient { | ||
## Known Issues | ||
- Missing return type for methods, Maybe in the future, I will add return types for methods by parsing the official documentation with a ChatGPT. | ||
## License | ||
**@types/telegram-bot-api** is released under the MIT license. [See LICENSE](LICENSE) for details. |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
360189
110