<commit_before># Botgram

Microframework to build Telegram bots.

~~~ js
var botgram = require("botgram");
var bot = botgram("<auth token>");

bot.command("start", "help", function (msg, reply, next) {
  reply.text("To schedule an alert, do: /alert <seconds> <text>");
});

bot.command("alert", function (msg, reply, next) {
  var args = msg.args(2);
  var seconds = Number(args[0]), text = args[1];
  if (isNaN(seconds) || !text) return next();

  setTimeout(function () {
    reply.text(text);
  }, seconds * 1000);
});

bot.command(function (msg, reply, next) {
  reply.text("Invalid command.");
});
~~~
<commit_msg>README: Use ES6 syntax for example<commit_after># Botgram

Microframework to build Telegram bots.

~~~ js
const botgram = require("botgram")
const bot = botgram("<auth token>")

bot.command("start", "help", (msg, reply) =>
  reply.text("To schedule an alert, do: /alert <seconds> <text>"))

bot.command("alert", (msg, reply) => {
  var [ seconds, text ] = msg.args(2)
  if (!seconds.match(/^\d+$/) || !text) return next()

  setTimeout(() => reply.text(text), Number(seconds) * 1000)
})

bot.command((msg, reply) =>
  reply.text("Invalid command."))
~~~

{'fraction_non_alphanumeric': 0.20119352088661552, 'fraction_numerical': 0.011082693947144074, 'mean_word_length': 4.671497584541063, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '434094', 'n_tokens_mistral': 409, 'n_tokens_neox': 394, 'n_words': 109}