Giter Site home page Giter Site logo

markov-bot's Introduction

A telegram bot based on markov chain

Deploy

Generate pseudo random sentences using the markov chain model. You will need Python3+ to use this project.

Installation

1. Download

$ git clone https://github.com/joaorafaelm/markov-bot
$ cd markov-bot

2. Requirements

$ pipenv install --dev

3. Env vars

In order to run the bot, you need to define the env vars TELEGRAM_TOKEN and ADMIN_USERNAMES*:

$ cp local.env .env
$ vim .env

Optionally you can set another trigger command to generate sentences. (default: /sentence)

Running the bot

After defining the variables, run:

$ pipenv run python markov.py

Add the bot to a group chat, disable the bot privacy settings (it means that the bot will receive all messages, not just the ones starting with "/") and run the command /enable to start collecting text. Run /sentence (or the command you defined using the env var SENTENCE_COMMAND) to generate random sentences. You might need a reasonable amount of text before getting some sentences. If you wish to delete the model, run /remove.

Providing initial data

If you already have some text, place it in the data/ dir in a <name_of_the_chat_group>.txt file.

Have fun :)

markov-bot's People

Contributors

joaorafaelm avatar

Watchers

Guilherme Fabrizio avatar James Cloos avatar

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.