
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
telegram-ts-api
Advanced tools
import Telegram from "./src/Telegram";
Telegram.launchBot(TELEGRAM_API);
where TELEGRAM_API is your bot token const user_id = 100000;
await Telegram.user(user_id).message(`Hello!`);
3.1 Keyboard buttons
const button = Telegram.button('keyboard', {pageId: "Main", name: "Phone Number Get", layer: 0});
## Attributes
- pageId - (string or number): used to create specific space where the button is located
- layer - (number): row on the page where the button is located
- name - (string): button name
To force the button to process events, call the following code
const button = Telegram.button('keyboard', {pageId: "Main", name: "Phone Number Get", layer: 0});
button.click(async (msg: any) =>
{
const id = msg.from.id;
const name = msg.from.name;
// On event open another button page using 'messageWithData'
// Second argument 'true' is 'one_time_keyboard'
// If it's true after click event keyboard will close
await Telegram.user(id).messageWithData("hi", await Telegram.getKeyboardButtonPageById("Phone Number", true));
});
3.2 Inline buttons
const button = Telegram.button('keyboard', {pageId: "Main", name: "Phone Number Get", layer: 0});
## Attributes
- pageId - (string or number): used to create specific space where the button is located
- layer - (number): row on the page where the button is located
- name - (string): button name
To force the button to process events, call the following code
const button = Telegram.button('inline', {pageId: "Main", callback: "Main", name: "Phone Number Get", layer: 0});
button.click(async (msg: any) =>
{
const id = msg.from.id;
const name = msg.from.name;
await Telegram.user(userId).messageWithData("hi", await Telegram.getInlineButtonPageById("Main"));
});
FAQs
High level wrapper for node-telegram-bot-api
The npm package telegram-ts-api receives a total of 7 weekly downloads. As such, telegram-ts-api popularity was classified as not popular.
We found that telegram-ts-api demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.