2.0.6 • Published 1 year ago

@busshi/telegram-api v2.0.6

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

publish

npm-telegram-api

Node package for the Telegram API

Installation

yarn add @busshi/telegram-api or npm install @busshi/telegram-api

Functionnalities

MethodParameters
sendMessagechatId: stringtext: stringdisableNotification: boolean (optional, default: false)
editMessagechatId: stringmessageId: stringtext: string
deleteMessagechatId: stringmessageId: string
sendPhotochatId: stringpicUrl: stringdisableNotification: boolean (optional, default: false)
sendDocumentchatId: stringfileUrl: stringdisableNotification: boolean (optional, default: false)
sendVideoNotechatId: stringvideoUrl: stringdisableNotification: boolean (optional, default: false)
sendPollchatId: stringquestion: stringoptions: string[]disableNotification: boolen (optional, default: false)isAnonymous: boolean (optional, default: false)
sendStickerchatId: stringstickerId: string
sendDicechatId: string (get a random number from 1 to 6)

Usage

import Telegram from '@busshi/telegram-api';

const telegram = new Telegram(BOT_TOKEN);

const req = await telegram.sendMessage(CHAT_ID, 'Hello world!');
const messageId = req.dat.result.message_id;

telegram.editMessage(CHAT_ID, messageId, 'Edited message');

telegram.deleteMessage(CHAT_ID, messageId);

telegram.sendPhoto(CHAT_ID, PICTURE_URL);

telegram.sendDocument(CHAT_ID, DOCUMENT_URL);

telegram.sendVideoNote(CHAT_ID, VIDEO_URL);

telegram.sendPoll(CHAT_ID, QUESTION, OPTIONS);
telegram.sendPoll(CHAT_ID, 'Is it working?', ['yes', 'no']);

telegram.sendSticker(CHAT_ID, STICKER_ID);
telegram.sendSticker(CHAT_ID, 'CAACAgIAAxkBAAI6GV6vP_F6BaWapEmBZ2k8e8yBi2xMAAICAwACusCVBTRFBuRNlNodGQQ');

telegram.sendDice(CHAT_ID);
2.0.6

1 year ago

2.0.5

1 year ago

2.0.4

1 year ago

2.0.3

1 year ago

2.0.2

1 year ago

2.0.1

1 year ago

2.0.0

1 year ago

1.0.0

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago