<commit_before>const { RedisClient, createClient, Multi } = require('redis')
const bluebird = require('bluebird')

bluebird.promisifyAll(RedisClient.prototype)
bluebird.promisifyAll(Multi.prototype)

module.exports = class Botact {
  constructor (settings) {
    const { confirmation, token, flowTimeout: timeout, redis = false, redisConfig = {} } = settings

    if (!confirmation) {
      throw new Error('confirmation is required')
    } else if (!token) {
      throw new Error('token is required')
    }

    this.flow = { scenes: {}, session: {}, timeout }
    this.actions = { commands: [], hears: [], events: [], on: [], middlewares: [] }
    this.methods = []
    this.settings = settings
    this.redis = redis && createClient(redisConfig)

    this.api = require('./api')
    this.getOptions = require('./methods/options/get').bind(this)
    this.setOptions = require('./methods/options/set').bind(this)
    this.deleteOptions = require('./methods/options/delete').bind(this)
    this.before = require('./methods/before').bind(this)
    this.use = require('./methods/use').bind(this)
    this.command = require('./methods/command').bind(this)
    this.hears = require('./methods/hears').bind(this)
    this.on = require('./methods/on').bind(this)
    this.event = require('./methods/event').bind(this)
    this.reply = require('./methods/reply').bind(this)
    this.handler = require('./methods/handler').bind(this)
    this.uploadDocument = require('./methods/upload/document').bind(this)
    this.uploadPhoto = require('./methods/upload/photo').bind(this)
    this.uploadCover = require('./methods/upload/cover').bind(this)
    this.addScene = require('./methods/flow/add').bind(this)
    this.joinScene = require('./methods/flow/join').bind(this)
    this.nextScene = require('./methods/flow/next').bind(this)
    this.leaveScene = require('./methods/flow/leave').bind(this)
    this.listen = require('./methods/listen').bind(this)
    this.execute = require('./methods/execute').bind(this)
    this.executeHandler = require('./utils/executeHandler')
    this.getLastMessage = require('./utils/getLastMessage')

    setInterval(() => {
      this.executeHandler(this.methods)
      this.methods = []
    }, (1000 / 20))
  }

  get options () {
    return this.getOptions()
  }

  set options (settings) {
    return this.setOptions(settings)
  }

  static execute (method, settings, callback) {
    return this.execute(method, settings, callback)
  }

  async before (callback) {
    return await this.before(callback)
  }

  deleteOptions (keys) {
    return this.deleteOptions(keys)
  }

  use (callback) {
    return this.use(callback)
  }
<commit_msg>delete async/await from class<commit_after>const { RedisClient, createClient, Multi } = require('redis')
const bluebird = require('bluebird')

bluebird.promisifyAll(RedisClient.prototype)
bluebird.promisifyAll(Multi.prototype)

module.exports = class Botact {
  constructor (settings) {
    const { confirmation, token, flowTimeout: timeout, redis = false, redisConfig = {} } = settings

    if (!confirmation) {
      throw new Error('confirmation is required')
    } else if (!token) {
      throw new Error('token is required')
    }

    this.flow = { scenes: {}, session: {}, timeout }
    this.actions = { commands: [], hears: [], events: [], on: [], middlewares: [] }
    this.methods = []
    this.settings = settings
    this.redis = redis && createClient(redisConfig)

    this.api = require('./api')
    this.getOptions = require('./methods/options/get').bind(this)
    this.setOptions = require('./methods/options/set').bind(this)
    this.deleteOptions = require('./methods/options/delete').bind(this)
    this.before = require('./methods/before').bind(this)
    this.use = require('./methods/use').bind(this)
    this.command = require('./methods/command').bind(this)
    this.hears = require('./methods/hears').bind(this)
    this.on = require('./methods/on').bind(this)
    this.event = require('./methods/event').bind(this)
    this.reply = require('./methods/reply').bind(this)
    this.handler = require('./methods/handler').bind(this)
    this.uploadDocument = require('./methods/upload/document').bind(this)
    this.uploadPhoto = require('./methods/upload/photo').bind(this)
    this.uploadCover = require('./methods/upload/cover').bind(this)
    this.addScene = require('./methods/flow/add').bind(this)
    this.joinScene = require('./methods/flow/join').bind(this)
    this.nextScene = require('./methods/flow/next').bind(this)
    this.leaveScene = require('./methods/flow/leave').bind(this)
    this.listen = require('./methods/listen').bind(this)
    this.execute = require('./methods/execute').bind(this)
    this.executeHandler = require('./utils/executeHandler')
    this.getLastMessage = require('./utils/getLastMessage')

    setInterval(() => {
      this.executeHandler(this.methods)
      this.methods = []
    }, (1000 / 20))
  }

  get options () {
    return this.getOptions()
  }

  set options (settings) {
    return this.setOptions(settings)
  }

  static execute (method, settings, callback) {
    return this.execute(method, settings, callback)
  }

  before (callback) {
    return this.before(callback)
  }

  deleteOptions (keys) {
    return this.deleteOptions(keys)
  }

  use (callback) {
    return this.use(callback)
  }

{'fraction_non_alphanumeric': 0.16903781355297642, 'fraction_numerical': 0.0022463496817671283, 'mean_word_length': 3.586266094420601, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '2164176', 'n_tokens_mistral': 1588, 'n_tokens_neox': 1554, 'n_words': 277}