capezotte / crab-rave

Markov chain chatbot

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

crab rave

Send him /cu and he'll spill out nonsense.

Require Sqlite3 and Rust >= 1.61.

DIY

Set the TELOXIDE_TOKEN environment variable to your Telegram bot token.

Upon the first run, the bot will look for a file called in.txt, using the following format:

  • Lines starting with an empty space, containing a single word, are words that can begin a sentence.
  • Lines not starting with an empty space, contaning a single word, are words that can end a sentence.
  • Lines not starting with an empty space, containing two words, are a word pair.

For example, the sentence blazing fast memory safe nonsense generator will generate:

 blazing
blazing fast
fast memory
memory safe
safe nonsense
nonsense generator
generator

The contrib subfolder has the telegram2crabrave jq script that can convert a Telegram JSON chat dump into this format, as well as a mkdb bash script that works with line-by-line entries.

It'll be converted to an indexed sqlite database stored under markov.sqlite.

About

Markov chain chatbot


Languages

Language:Rust 96.3%Language:Shell 3.7%