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

tgb

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tgb - npm Package Compare versions

Comparing version 0.4.0 to 0.4.1

examples/polling.js

2

package.json
{
"name": "tgb",
"version": "0.4.0",
"version": "0.4.1",
"description": "The best choice for your Telegram Bots",

@@ -5,0 +5,0 @@ "homepage": "https://666.io",

@@ -41,3 +41,3 @@ [![Codacy][cod_b]][cod_l]

const bot = tgb(process.env.TELEGRAM_BOT_TOKEN);
const token = process.env.TELEGRAM_BOT_TOKEN;
const {polling, entities} = tgb;

@@ -47,6 +47,6 @@

polling(bot, function({message}, bot) {
bot.sendMessage([message.from.id, entities(message)]);
polling(token, function({message}, bot) {
bot.sendMessage([message.from.id, entities(message) || "empty"]);
}).catch(function(error) {
if(error.code === bot.ERR_INVALID_TOKEN) {
if(error.code === tgb.ERR_INVALID_TOKEN) {
this.stop();

@@ -66,3 +66,3 @@ console.log("There's a problem with the token...");

// tgb.polling(token, options{limit, timeout, interval}, onMsg(data, bot));
// tgb.polling(bot, ...);
// tgb.polling(bot, onMsg(data));

@@ -190,3 +190,3 @@ // https://core.telegram.org/bots/api#getupdates

[bot_command/start, hashtag#win, message[...]]
[message[...], bot_command/start, hashtag#win]

@@ -453,3 +453,3 @@ ^---| The Spy calls only the first available scope

"text": "NANI?!"
}).inlineLink("Omae wa ... mou shindeiru ", "db.gg"));
}).inlineLink("Omae wa ... mou shindeiru", "db.gg"));

@@ -456,0 +456,0 @@

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