<commit_before>'use strict'

var config = require('../../config');
var https = require('https');
var qs = require('querystring');

var tg = {};

tg.setupWebhook = function() {
    https.get(
        config.TELEGRAM_FULL_URL +
        '/setWebhook' +
        '?url=' +
        config.WEBHOOK_BASE_URL +
        config.BOT_WEBHOOK_PATH
    ).on('error', function(e) {
        console.log(`Problem with request: ${e.message}`);
    });
};

tg.sendTextMessage = function(text, chatId, parseMode, hidePreview, replyTo, replyMarkup) {

    var postData = JSON.stringify({
        text: text,
        chat_id : chatId,
        parse_mode: parseMode || '',
        disable_web_page_preview: hidePreview || 0,
        reply_to_message_id: replyTo || '',
        reply_markup: replyMarkup || ''
    });

    var options = {
        hostname: config.TELEGRAM_BASE_URL,
        port: 443,
        path: '/bot' + config.TOKEN + '/sendMessage',
        method: 'POST',
        headers: {
            'Content-Type': 'application/json',
            'Content-Length': Buffer.byteLength(postData)
        }
    };

    var req = https.request(options);

    req.on('error', function(e) {
        console.log(`Problem with request: ${e.message}`);
    });

    req.write(postData);
    req.end();
};

tg.selectiveForceReply = function (text, message, parseMode, hidePreview) {
    tg.sendTextMessage(
        text,
        requestMessage.chat.id,
        parseMode,
        hidePreview,
        requestMessage.message_id,
        {
            'force_reply': true,
            'selective': true
        }
    );
};

module.exports = tg;<commit_msg>Fix force reply<commit_after>'use strict'

var config = require('../../config');
var https = require('https');
var qs = require('querystring');

var tg = {};

tg.setupWebhook = function() {
    https.get(
        config.TELEGRAM_FULL_URL +
        '/setWebhook' +
        '?url=' +
        config.WEBHOOK_BASE_URL +
        config.BOT_WEBHOOK_PATH
    ).on('error', function(e) {
        console.log(`Problem with request: ${e.message}`);
    });
};

tg.sendTextMessage = function(text, chatId, parseMode, hidePreview, replyTo, replyMarkup) {

    var postData = JSON.stringify({
        text: text,
        chat_id : chatId,
        parse_mode: parseMode || '',
        disable_web_page_preview: hidePreview || 0,
        reply_to_message_id: replyTo || '',
        reply_markup: replyMarkup || ''
    });

    var options = {
        hostname: config.TELEGRAM_BASE_URL,
        port: 443,
        path: '/bot' + config.TOKEN + '/sendMessage',
        method: 'POST',
        headers: {
            'Content-Type': 'application/json',
            'Content-Length': Buffer.byteLength(postData)
        }
    };

    var req = https.request(options);

    req.on('error', function(e) {
        console.log(`Problem with request: ${e.message}`);
    });

    req.write(postData);
    req.end();
};

tg.selectiveForceReply = function (text, message, parseMode, hidePreview) {
    tg.sendTextMessage(
        text,
        message.chat.id,
        parseMode,
        hidePreview,
        message.message_id,
        {
            'force_reply': true,
            'selective': true
        }
    );
};

module.exports = tg;
{'fraction_non_alphanumeric': 0.1440886699507389, 'fraction_numerical': 0.0024630541871921183, 'mean_word_length': 2.2457542457542456, 'pattern_counts': {'":': 0, '<': 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': '4017049', 'n_tokens_mistral': 1037, 'n_tokens_neox': 1003, 'n_words': 193}