Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

telenode-js

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

telenode-js - npm Package Compare versions

Comparing version 1.4.2 to 1.5.0

examples/chatAction.js

2

package.json
{
"name": "telenode-js",
"version": "1.4.2",
"version": "1.5.0",
"description": "Lightweight Telegram API framework for Node.js",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -28,5 +28,9 @@ # Telenode

✅ Long polling support
<br>
✅ Sending chat action
## Getting started
#### Complete example can be found [here](https://github.com/NivEz/movie-info-bot)
### Installation

@@ -33,0 +37,0 @@

@@ -8,2 +8,15 @@ const { runServer } = require('./server');

#secretToken;
validChatActions = [
'typing',
'upload_photo',
'record_video',
'upload_video',
'record_voice',
'upload_voice',
'upload_document',
'choose_sticker',
'find_location',
'record_video_note',
'upload_video_note',
];

@@ -190,4 +203,19 @@ constructor({ apiToken, secretToken }) {

}
async sendChatAction(chatId, chatAction) {
if (!this.validChatActions.includes(chatAction)) {
throw new Error(
`Invalid chat action. Valid chat action should be one of: ${this.validChatActions.join(
', ',
)}`,
);
}
const url = this.#baseUrl + '/sendChatAction';
await axios.post(url, {
chat_id: chatId,
action: chatAction,
});
}
}
module.exports = Telenode;
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc