Skip to content

dimotsai/kekeke-cq-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kekeke-cq-bot

sugar_bot & cotton_bot on https://kekeke.cc/crusaders-quest

Requirements

For Windows

Please install the following packages before started:

After install node.js and git, open Node.js command prompt and move to Installation section

For Linux

Please install the following packages:

  • git
  • nodejs

Installation

Download required projects:

git clone https://github.com/dimotsai/kekeke
git clone https://github.com/dimotsai/kekeke-cq-bot

Setup local dependecies:

cd kekeke
npm link

Install packages:

cd kekeke-cq-bot
npm link kekeke
npm install

Start a bot manually

Modify the config:

vim config/default.json

For example:

{
  "api": {
    "hostname": "localhost",
    "port": 30000
  },
  "bot": {
    "anonymousId": "ANONYMOUS_ID_FROM_KEKEKE_CC",
    "nickname": "sugar_bot",
    "topic": "crusaders-quest"
  },
  "logger": {
    "anonymousId": "ANONYMOUS_ID_FROM_KEKEKE_CC",
    "nickname": "cotton_bot",
    "topic": "crusaders-quest"
  },
  "mongodb": {
    "host": "localhost",
    "port": 27017,
    "dbname": "cq",
    "username": "DB_USERNAME",
    "password": "DB_PASSWORD"
  }
}

Note: You can find anonymousId in the local storage of kekeke.cc with the name hiroba.anonymousId. To inspect the local storage, you can use browsers' developer tools!

To run a chat bot, you simply run:

npm run bot

Note: you may not have enough kerma to reply every message, try starting a bot for a couple of hours to accumulate kerma.

Start a bot using pm2

Install pm2

npm install -g pm2

Use pm2 to run a chat bot as a daemon

cd kekeke-bot
pm2 start src/bot.js --name "mybot"