takyon-log
v1.0.0
Published
This is an npm package that allows interacting with the Takyon Log Service API, in order to send log messages through the Telegram platform.
Downloads
2
Readme
Takyon Log npm Package
This is an npm package that allows interacting with the Takyon Log Service API, in order to send log messages through the Telegram platform.
Installation
Use the package manager npm to install this package.
npm install takyon-log
Usage
Import the package into your project and use the following functions:
sendTakyonLogMessage(message:string, chatId: string, token: string)
: To send a message to your Telegram channel. The fefunctions requires an authentication Bearer Token.
import { sendTakyonLogMessage } from "takyon-log";
sendTakyonLogMessage(
"your_message_log",
"your_chat_id_telegram",
"your_apikey_token"
)
.then((response) => console.log(response))
.catch((error) => console.error(error));
Error Handling
If the request fails, the functions will throw an error with the response error message.
try {
const response = await sendTakyonLogMessage(
"your_message_log",
"your_chat_id_telegram",
"your_apikey_token"
);
} catch (error) {
console.error(error);
}
License
This package is licensed under the MIT license.