<commit_before>var config = require('./config');
var token = config.telegramToken;

var PluginManager = require('./plugins');
var plugins = new PluginManager();

var TelegramBot = require('node-telegram-bot-api');
var bot = new TelegramBot(token, {
    polling: true
});

console.log("The bot is starting...");
plugins.runPlugins(config.activePlugins);

bot.on('message', function(msg) {
    if (msg.text) {
        var chatId = msg.chat.id;

        plugins.doMessage(msg, function(reply) {
            switch (reply.type) {
                case "text":
                    bot.sendMessage(chatId, reply.text);
                    break;
                case "audio":
                    bot.sendAudio(chatId, reply.audio);
                    break;
                case "photo":
                    bot.sendPhoto(chatId, reply.photo);
                    break;
                case "status":
                    bot.sendChatAction(chatId, reply.status);
                    break;
                default:
                    console.log("Error: Unrecognized response");
            }
        });
    }
});

// If `CTRL+C` is pressed we stop the bot safely.
process.on('SIGINT', shutDown);

// Stop safely in case of `uncaughtException`.
process.on('uncaughtException', shutDown);

function shutDown() {<commit_msg>Added sticker support<commit_after>var config = require('./config');
var token = config.telegramToken;
var PluginManager = require('./plugins');
var plugins = new PluginManager();

var TelegramBot = require('node-telegram-bot-api');
var bot = new TelegramBot(token, {
    polling: true
});

console.log("The bot is starting...");
plugins.runPlugins(config.activePlugins);

bot.on('message', function(msg) {
    if (msg.text) {
        var chatId = msg.chat.id;

        plugins.doMessage(msg, function(reply) {
            switch (reply.type) {
                case "text":
                    bot.sendMessage(chatId, reply.text);
                    break;
                case "audio":
                    bot.sendAudio(chatId, reply.audio);
                    break;
                case "photo":
                    bot.sendPhoto(chatId, reply.photo);
                    break;
                case "status":
                    bot.sendChatAction(chatId, reply.status);
                    break;
                case "sticker":
                    bot.sendSticker(chatId, reply.sticker);
                    break;
                default:
                    console.log("Error: Unrecognized response");
            }
        });
    }
});

// If `CTRL+C` is pressed we stop the bot safely.
process.on('SIGINT', shutDown);

// Stop safely in case of `uncaughtException`.
process.on('uncaughtException', shutDown);

function shutDown() {
{'fraction_non_alphanumeric': 0.12445730824891461, 'fraction_numerical': 0.0, 'mean_word_length': 1.7677677677677677, 'pattern_counts': {'":': 9, '<': 3, '<?xml version=': 0, '>': 3, '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': '3410039', 'n_tokens_mistral': 763, 'n_tokens_neox': 723, 'n_words': 173}