pwrtelegram
Advanced tools
Comparing version
{ | ||
"name": "pwrtelegram", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"main": "lib/index.js", | ||
"description": "A Node.js Library for the PWRTelegram User API, which is the equivalent to Telegram's Client API", | ||
"main": "index.js", | ||
"scripts": { | ||
"gen-doc": "jsdoc2md --files index.js --template api.hbs > README.md" | ||
"gen-doc": "jsdoc2md --files lib/index.js > doc/api.md", | ||
"test": "istanbul cover ./node_modules/mocha/bin/_mocha" | ||
}, | ||
@@ -31,6 +32,10 @@ "keywords": [ | ||
"pino": "^4.0.3", | ||
"querystring": "^0.2.0", | ||
"request": "^2.81.0", | ||
"request-promise": "^4.1.1" | ||
}, | ||
"devDependencies": { | ||
"istanbul": "^0.4.5", | ||
"mocha": "^3.2.0", | ||
"should": "^11.2.1" | ||
} | ||
} |
[](https://telegram.me/kamikazechaser) | ||
[](https://telegram.me/Bestulo) | ||
[](https://travis-ci.org/kamikazechaser/pwrtelegram) | ||
[](https://codecov.io/gh/kamikazechaser/pwrtelegram) | ||
>PWRTelegram User API | ||
A Node.js Library for the PWRTelegram User API, which is the equivalent to Telegram's Client API | ||
A Node.js Library for the PWRTelegram User API | ||
> Powered by [PWRTelegram API](http://pwrtelegram.xyz/) | ||
## About | ||
This library allows you to invoke Telegram's core API methods, using PWRTelegram API as a mediator. This allows one to build user bots. | ||
**Important Information** | ||
- Based on [MadelineProto](https://daniil.it/MadelineProto/API_docs/) layer 62 | ||
- It is HIGHLY recommended to run [your own instance](https://github.com/pwrtelegram/pwrtelegram-backend) of PWRTelegram for speed | ||
- The global instance is [under heavy load](https://t.me/daniilgentili/125), so requests may take upto 15 seconds | ||
- This library is promised based | ||
- This library returns actual server errors for debugging purposes | ||
## Install | ||
@@ -17,68 +32,14 @@ | ||
<a name="User"></a> | ||
- [Library](https://github.com/kamikazechaser/pwrtelegram/blob/master/doc/api.md) | ||
- [Telegram Core API](https://core.telegram.org/methods) | ||
- [Madeline Proto](https://daniil.it/MadelineProto/API_docs/methods/) | ||
## User | ||
User | ||
## Issues And Contribution | ||
**Kind**: global class | ||
Fork the repository and submit a pull request for whatever change you want to be added to this project. If you have any questions, just open an issue. | ||
* [User](#User) | ||
* [new User(token, baseUrl)](#new_User_new) | ||
* [.sendMessage(chatId, text)](#User+sendMessage) ⇒ <code>Promise</code> | ||
* [.setTyping(chatId, action)](#User+setTyping) ⇒ <code>Promise</code> | ||
* [.forwardMessage(chatId, messageId)](#User+forwardMessage) ⇒ <code>Promise</code> | ||
Before submitting a pull request, see the contribution [guidelines](https://github.com/kamikazechaser/pwrtelegram/blob/master/CONTRIBUTING.md). | ||
<a name="new_User_new"></a> | ||
## License | ||
### new User(token, baseUrl) | ||
| Param | Type | Description | | ||
| --- | --- | --- | | ||
| token | <code>String</code> | Bot Token | | ||
| baseUrl | <code>String</code> | (Optional) Custom pwetelegram API instance URL | | ||
<a name="User+sendMessage"></a> | ||
### user.sendMessage(chatId, text) ⇒ <code>Promise</code> | ||
Send text message. | ||
**Kind**: instance method of <code>[User](#User)</code> | ||
**Returns**: <code>Promise</code> - Updates | ||
**See**: https://core.telegram.org/method/messages.sendMessage | ||
| Param | Type | Description | | ||
| --- | --- | --- | | ||
| chatId | <code>Number</code> | <code>String</code> | Unique identifier for the message recipient | | ||
| text | <code>String</code> | Text of the message to be sent | | ||
<a name="User+setTyping"></a> | ||
### user.setTyping(chatId, action) ⇒ <code>Promise</code> | ||
Set typing. | ||
**Kind**: instance method of <code>[User](#User)</code> | ||
**Returns**: <code>Promise</code> - Boolean | ||
**See**: https://core.telegram.org/method/messages.setTyping | ||
| Param | Type | Description | | ||
| --- | --- | --- | | ||
| chatId | <code>Number</code> | <code>String</code> | Unique identifier for the message recipient | | ||
| action | <code>String</code> | Type of action to be sent | | ||
<a name="User+forwardMessage"></a> | ||
### user.forwardMessage(chatId, messageId) ⇒ <code>Promise</code> | ||
Forward text message. | ||
**Kind**: instance method of <code>[User](#User)</code> | ||
**See**: https://core.telegram.org/method/messages.forwardMessage | ||
| Param | Type | Description | | ||
| --- | --- | --- | | ||
| chatId | <code>Number</code> | <code>String</code> | Unique identifier for the message recipient | | ||
| messageId | <code>Number</code> | <code>String</code> | Unique identifier of the message to be forwarded | | ||
## Issues And Contribution | ||
Fork the repository and submit a pull request for whatever change you want to be added to this project. If you have any questions, just open an issue. | ||
Released under AGPL-3.0 |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
46553
8.41%3
-25%8
14.29%160
64.95%3
Infinity%44
-46.99%2
Infinity%1
Infinity%- Removed
- Removed