Skip to content
/ joebot Public

Turning VKontakte mesage history into a Discord chat game

Notifications You must be signed in to change notification settings

texbois/joebot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Джобот

Discord chat games based on your VKontakte mesage history, featuring:

  • Taki (Polish for such) — a guessing game for people who think they know each other well :^)
  • Joker — _Impact_ful philosophical ruminations on society and life
  • Mashup — a Markov chain generator with time- and source-based selection of inputs
  • WDYT — klook up your past thoughts about anything (well, anything you've written before, at least...)
  • Img2msgWDYT

Plus some utilities to avoid having third-party bots in the chatroom:

  • Poll, a Simple Poll clone

Acknowledgements

WDYT and Joker functionality is ported from sunDalik/vk-bot.

Legacy versions

  • Telegram (only featuring Taki, but much more lightweight thanks to a handwritten API client)

Building the bot

Start by exporting a Vkontakte chat you'd like to have as the base for the chat games. Use VkOpt (be sure to select the Export as .html option).

The exported message dump should be named messages.html and placed in the joebot crate root.

Next, in the joebot crate root:

  1. Create a chain_sources.json file listing the sources for the textual Markov chain, for example:
[
  { "type": "MessageDump", "path": "path/to/vkopt/message/dump.html", "short_name_regexes": { "short_name": "r|e" } },
  { "type": "Text", "path": "книга.txt", "name_regex": "книга", "year": 2017, "day": 200 },
]
  1. Run cargo run --release --example mkbin to covert the specified sources to chain data.

Getting up & running

  1. Deploy the following files:
  • target/release/joebot
  • chain.bin
  • messages.html
  • imclassif.py
  • keyword_mapping.json
  1. Create a config.json file with the following contents:
{
  // The bot only responds to messages from this channel:
  "channel_id": 0000,
  // Only users with the short names defined below
  // are included in chat games:
  "user_matcher": {
    "short_name": "regex|to|match|name"
  },
  "user_penalties": {
    // Penalized users appear less frequently in Taki games
    // Max penalty = number of users, removes the user from Taki entirely
    // (useful if you want to keep their messages for other games)
    "short_name": 1,
  }
}
  1. Install imclassif.py dependencies by running
pip3 install --user -r requirements.txt

About

Turning VKontakte mesage history into a Discord chat game

Resources

Stars

Watchers

Forks