Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const Logger = require('../includes/logger.js');
const DB = require('./db.js');
const { PRIVATE_TEST_CHANNELS } = require('../consts.js');
const { SLACK_BOT_TOKEN, SLACK_USER_TOKEN } = process.env;
const RTM = new RTMClient(SLACK_BOT_TOKEN);
const PR_REGEX = /github\.com\/([\w-.]*)?\/([\w-.]*?)\/pull\/(\d+)/i;
const PR_REGEX_GLOBAL = new RegExp(PR_REGEX.source, `${PR_REGEX.flags}g`);
const user_client = new WebClient(SLACK_USER_TOKEN, {
retryConfig: retryPolicies.rapidRetryPolicy,
});
const bot_client = new WebClient(SLACK_BOT_TOKEN, {
retryConfig: retryPolicies.rapidRetryPolicy,
});
exports.bot_client = bot_client;
exports.user_client = user_client;
const balancer = new Queue({
rules: {
common: {
rate: 50,
limit: 60,
priority: 5,
},
send_message: {
rate: 2,
limit: 1,
priority: 2,
const { WebClient, retryPolicies } = require('@slack/web-api');
const Queue = require('smart-request-balancer');
const memoize = require('memoizee');
const Logger = require('../includes/logger.js');
const DB = require('./db.js');
const { PRIVATE_TEST_CHANNELS } = require('../consts.js');
const { SLACK_BOT_TOKEN, SLACK_USER_TOKEN } = process.env;
const RTM = new RTMClient(SLACK_BOT_TOKEN);
const PR_REGEX = /github\.com\/([\w-.]*)?\/([\w-.]*?)\/pull\/(\d+)/i;
const PR_REGEX_GLOBAL = new RegExp(PR_REGEX.source, `${PR_REGEX.flags}g`);
const user_client = new WebClient(SLACK_USER_TOKEN, {
retryConfig: retryPolicies.rapidRetryPolicy,
});
const bot_client = new WebClient(SLACK_BOT_TOKEN, {
retryConfig: retryPolicies.rapidRetryPolicy,
});
exports.bot_client = bot_client;
exports.user_client = user_client;
const balancer = new Queue({
rules: {
common: {
rate: 50,
limit: 60,
priority: 5,
},
send_message: {