Charlie Laabs 457baee96d Support thread messages. Resolves #23.
Improved edit and delete support (switched to tags).
Remove embed when train command is finished.
2022-01-09 16:25:55 -06:00
2022-01-01 23:10:02 -06:00
2022-01-04 22:15:33 -06:00
2022-01-04 22:15:33 -06:00
2021-12-29 23:27:54 -06:00
2022-01-04 22:15:33 -06:00
2021-12-19 16:59:13 -06:00
2022-01-09 15:05:32 -06:00
2022-01-04 22:15:10 -06:00
2021-12-29 23:27:54 -06:00
2022-01-04 22:15:33 -06:00
2022-01-04 22:15:33 -06:00
2022-01-04 22:15:33 -06:00

MarkBot for Discord

A Markov chain bot using markov-strings.

Usage

  1. Configure what channels you want the bot to listen/learn from:
    • User: /listen modify
    • Bot: Select which channels your would like the bot to actively listen to
  2. Train the bot in a lengthy text channel:
    • User: /train
    • Bot: Parsing past messages from 5 channel(s).
  3. Ask the bot to say something:
    • User: /mark
    • Bot: worms are not baby snakes, by the way

Setup

This bot stores your Discord server's entire message history, so a public instance to invite to your server is not available due to obvious data privacy concerns. Instead, you can host it yourself.

  1. Create a Discord bot application
  2. Under the "Bot" section, enable the "Message Content Intent", and copy the token for later.
  3. Setup and configure the bot using one of the below methods:

Docker

Running this bot in Docker is the easiest way to ensure it runs as expected and can easily recieve updates.

  1. Install Docker for your OS

  2. Open a command prompt and run:

    docker run --rm -ti -v /my/host/dir:/usr/app/config ghcr.io/claabs/markov-discord:latest
    

    Where /my/host/dir is a accessible path on your system.

  3. The Docker container will create a default config file in your mounted volume (/my/host/dir). Open it and add your bot token. You may change any other values to your liking as well. Details for each configuration item can be found here: https://claabs.github.io/markov-discord/classes/AppConfig.html

  4. Run the container again and use the invite link printed to the logs.

Windows

  1. Install Node.js 16 or newer.

  2. Download this repository using git in a command prompt

    git clone https://github.com/claabs/markov-discord.git
    

    or by just downloading and extracting the project zip from GitHub.

  3. Open a command prompt in the markov-discord folder.

    # NPM install non-development packages
    npm ci --only=production
    # Build the Typescript
    npm run build
    # Initialize the config
    npm start
    
  4. The program will create a config/config.json in the project folder. Open it and add your bot token. You may change any other values to your liking as well. Details for each configuration item can be found here: https://claabs.github.io/markov-discord/classes/AppConfig.html

  5. Run the bot:

    npm start
    

    And use the invite link printed to the logs.

Description
A Markov chain Discord chat bot. Generates unique messages by learning from past messages. Also occasionally attaches images to messages.
Readme 1.7 MiB
Languages
TypeScript 61.4%
JavaScript 31%
Shell 5%
Python 2.1%
Dockerfile 0.5%