rs-vk-bot
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

VK Chat Bot SDK

Getting started


// get secret token for your bot
// https://vk.com/dev/bots_docs?f=1.1.%20Acquiring%20The%20Access%20Token

const vkClient = new ChatBotClient("vk-secret-token");
vkClient.on("message_new", async (vkMessage: VkMessage) => {
    console.log("Message", vkMessage);

    vkClient.reply(vkMessage.user_id, {
        message: "My reply"
    });
});
vkClient.start();

VK keyboard

 const keyboard = new Keyboard([
        new ButtonsRow([
            new TextButton("Football", 'positive'),
            new TextButton("Basketball", 'negative'),
            new TextButton("Tennis", 'secondary')
        ]),
        new ButtonsRow([new LocationButton({some: "payload"})]),
    ]).oneTime();
    client.reply("1123441", {
        message: 'Select your sport',
        keyboard: keyboard
    });

Readme

Keywords

Package Sidebar

Install

npm i rs-vk-bot

Weekly Downloads

1

Version

0.0.2

License

ISC

Unpacked Size

59.7 kB

Total Files

53

Last publish

Collaborators

  • radzserg