GithubHelp home page GithubHelp logo

meow / markov Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 32 KB

A simple Discord Markov Chain bot written in Rust

License: GNU Affero General Public License v3.0

Nix 3.23% Rust 96.77%

markov's Introduction

Simple Rust Markov Chain Bot

Should be fairly straightforward to run. Simply:

DISCORD_TOKEN=your_bot_token_here cargo run --release

Doesn't have any shared library dependencies or anything.

Design

By design, it reads every message and filters out staff-only channels (determined by channel name), then splits the message contents into words, and creates key-value pairs of (word, list_of_words_that_may_follow). If the list of following words is greater than 64 entries, the first one is popped before adding a new one. The "weight" of each word is determined by how many times it shows up in the list.

It's triggered on every message that contains Luna (case-insensitive), followed by any of the following keywords: what tell say thought opinion

Example:

Luna, what do you think?
Luna say something
I think Luna should tell us something

Todos

Maybe I'll make it more sane or something. I dunno. This was a simple Rust exercise designed to be tested in production. Don't test in production though.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.