<commit_before>const Wechaty = require('..')

const log = Wechaty.log
const welcome = `
| __        __        _           _
| \\ \\      / /__  ___| |__   __ _| |_ _   _
|  \\ \\ /\\ / / _ \\/ __| '_ \\ / _\` | __| | | |
|   \\ V  V /  __/ (__| | | | (_| | |_| |_| |
|    \\_/\\_/ \\___|\\___|_| |_|\\__,_|\\__|\\__, |
|                                     |___/

=============== Powered by Wechaty ===============
       -------- https://wechaty.io --------

I'm a bot, my super power is download cloud bot from wechaty.io

__________________________________________________

Starting...

`

console.log(welcome)
const bot = new Wechaty({ profile: 'io-bot' })

bot
.on('login'	  , user => log.info('Bot', `${user.name()} logined`))
.on('logout'	, user => log.info('Bot', `${user.name()} logouted`))
.on('scan'    , ({url, code}) => log.info('Bot', `${url}\n[${code}] Scan QR Code in above url to login: `))
.on('message', m => {
  m.ready()
    .then(msg => log.info('Bot', 'recv: %s', msg.toStringEx()))
    .catch(e => log.error('Bot', 'ready: %s' , e))
})

bot.init()
.catch(e => {
  log.error('Bot', 'init() fail: %s', e)
  bot.quit()
  process.exit(-1)
})

/**
 *
 * To make heroku happy
 *
 */
const app = require('express')()

app.get('/', function (req, res) {
  res.send('Wechaty Deployed on Heroku Succeed!')
})

app.listen(process.env.PORT, function () {
  console.log('Wechaty IO Bot listening on port ' + process.env.PORT + '!')
})<commit_msg>clearer msg digest output for room & contact<commit_after>const Wechaty = require('..')

const log = Wechaty.log
const welcome = `
| __        __        _           _
| \\ \\      / /__  ___| |__   __ _| |_ _   _
|  \\ \\ /\\ / / _ \\/ __| '_ \\ / _\` | __| | | |
|   \\ V  V /  __/ (__| | | | (_| | |_| |_| |
|    \\_/\\_/ \\___|\\___|_| |_|\\__,_|\\__|\\__, |
|                                     |___/

=============== Powered by Wechaty ===============
       -------- https://wechaty.io --------

I'm a bot, my super power is download cloud bot from wechaty.io

__________________________________________________

Starting...

`

console.log(welcome)
const bot = new Wechaty({ profile: 'io-bot' })

bot
.on('login'	  , user => log.info('Bot', `${user.name()} logined`))
.on('logout'	, user => log.info('Bot', `${user.name()} logouted`))
.on('scan'    , ({url, code}) => log.info('Bot', `${url}\n[${code}] Scan QR Code in above url to login: `))
.on('message', m => {
  m.ready()
    .then(onMessage)
    .catch(e => log.error('Bot', 'ready: %s' , e))
})

bot.init()
.catch(e => {
  log.error('Bot', 'init() fail: %s', e)
  bot.quit()
  process.exit(-1)
})

const onMessage = function(m) {
  const from = m.from()
  const to = m.to()
  const content = m.toString()
  const room = m.room()

  log.info('Bot', '%s<%s>:%s'
                , (room ? '['+room.name()+']' : '')
                , from.name()
                , m.toStringDigest()
          )
}
/**
 *
 * To make heroku happy
 *
 */
const app = require('express')()

app.get('/', function (req, res) {
  res.send('Wechaty Deployed on Heroku Succeed!')
})

app.listen(process.env.PORT, function () {
  console.log('Wechaty IO Bot listening on port ' + process.env.PORT + '!')
})
{'fraction_non_alphanumeric': 0.24960900844541759, 'fraction_numerical': 0.0006255864873318737, 'mean_word_length': 2.2732855680655066, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 17, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3043156', 'n_tokens_mistral': 1191, 'n_tokens_neox': 1175, 'n_words': 233}