web-standards-ru-calendar-telegram

0.0.2 • Public • Published

web-standards-ru-calendar-telegram

Telegram bot for web-standards-ru-calendar

Instaling

npm i -S web-standards-ru-calendar-telegram

Usage

const moment = require('moment');

const sendToChannel = require('web-standards-ru-calendar-telegram');

sendToChannel(`name: Яндекс Субботник
date: 10.12.2016
city: Москва
link: https://events.yandex.ru/events/yasubbotnik/10-dec-2016/
`, 'token', 'channel', 'proxy', (event) => {
    //this is a default value when this function is not set
    return `${event.name}\n\n${moment(event.start).utc().format("DD.MM.YYYY")}\n${event.city}\n${event.link}`;
})
    .then((res) => {
        const { status, body } = res;
        //check status == 200
    })
    .catch((err) => {
        console.warn(err);
    });

Tests

For test run

TOKEN='{bot_token}' CHANNEL='@{channel_name}' PROXY='{proxy_url}' npm run test
  • TOKEN - token telegrams bost
  • CHANNEL - channel name, for e.g. @test_channel (telegram bot must be a an administrator)
  • PROXY - proxy url, for e.g. socks://127.0.0.1:9050 for a local tor daemon

Versions

  • 0.0.1

Readme

Keywords

none

Package Sidebar

Install

npm i web-standards-ru-calendar-telegram

Weekly Downloads

1

Version

0.0.2

License

ISC

Unpacked Size

13.7 kB

Total Files

6

Last publish

Collaborators

  • dmitriym09