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

@tgairbot/core

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tgairbot/core

TgAirBot - это легковесная библиотека для простого взаимодействия с [Telegram Bot API](https://core.telegram.org/bots/api).

  • 0.4.0-alpha
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
31
decreased by-96.02%
Maintainers
1
Weekly downloads
 
Created
Source

TgAirBot

TgAirBot - это легковесная библиотека для простого взаимодействия с Telegram Bot API.

Установка

Вы можете установить TgAirBot с помощью npm:

npm install @tgairbot/core

Использование

Простой пример использования библиотеки:

import { useFilter, Polling, Methods, UpdateHandler } from "@tgairbot/core";

const TOKEN = "YOUR_TOKEN";

const polling = new Polling(TOKEN, { log: true });
const methods = new Methods(TOKEN);

polling.start().then();

const onMessageCallback: HandlerCallback<"message"> = async ({ params, wrapper }) => {
    useFilter(
        async () => params.text === "/start",
        params,
        async (res) => {
            await methods.sendMessage({
                replyToMessageId: params.messageId,
                chatId: params.chat.id,
                text: "Hello world!!!",
            });
        },
    );
};

UpdateHandler.onMessage(onMessageCallback);

Документация

Подробная документация доступна в нашей вики.

Лицензия

Эта библиотека лицензирована под MIT License - подробности см. в файле LICENSE.

Keywords

FAQs

Package last updated on 01 Dec 2023

Did you know?

Socket

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.

Install

Related posts

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