Coder Social home page Coder Social logo

trojaner / markovbot Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 197 KB

Impersonate any user by generating random messages in their unique writing style

License: MIT License

JavaScript 5.34% TypeScript 93.02% Dockerfile 1.64%
discord discord-bot markov-chain codellama text-generation

markovbot's Introduction

Discord Markov Impostor Bot

image image

This bot can impersonate any Discord user's unique writing style. It can generate text based on prompts or it can be completely random.

As this bot needs to save all channel messages when importing it cannot be a public bot for privacy reasons. You must self-host it to use it on your own servers.

Required permissions / intents

The bot needs the "Message Content" intent as it must be able to grab new messages. It also needs the following permissions:

  • Read Messages/View Channels
  • Send Messages
  • Read Message History
  • Manage Webhooks for channels where it can auto-reply or impersonate users

How to run

Setting up the database**

Run the migration.sql file inside the db folder. If you are not using postgresql create a similar table manually instead.

Setting up the environment

Create an .env file in the project's root directory with the following content (or pass as environment variables):

DISCORD_CLIENT_TOKEN="<your token>"
CONNECTION_STRING="<connection string>" # e.g. "postgres://postgres@localhost:5432/markov", see sequelizer documentation for more options
BOT_OWNER_ID="<your discord id>" # restricts /import command

Import messages

Run /import \<channel\> to import messages from a channel.
The more messages you have, the better the results are. Avoid importing gibberish from e.g. #bot-commands channels.
Regardless of that the bot will try to filter out unparsable messages like links or messages that seem like bot commands.

Using the bot

Impersonate Users

After importing you can impersonate any user using the /impersonate <user> [query] command.
The query parameter is optional and can be a word that the generated message should start with.

Hive Mind

You can also use /hive [query] where the bot impersonates the whole discord server as if it was a single person.

Todo:

  • Dockerfile
  • Periodic auto importing of messages
  • Randomly reply as random user (to questions?)

Credits:

The markov chain implementation is a modified version of code generated by Phind-CodeLlama 34B

markovbot's People

Contributors

trojaner avatar

Stargazers

 avatar  avatar  avatar

Watchers

 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.