https://github.com/trojaner/markovbot
Impersonate any user by generating random messages in their unique writing style
https://github.com/trojaner/markovbot
codellama discord discord-bot markov-chain text-generation
Last synced: about 1 year ago
JSON representation
Impersonate any user by generating random messages in their unique writing style
- Host: GitHub
- URL: https://github.com/trojaner/markovbot
- Owner: Trojaner
- License: mit
- Created: 2022-12-06T22:40:29.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-03-26T10:25:16.000Z (about 2 years ago)
- Last Synced: 2025-04-01T16:52:46.833Z (about 1 year ago)
- Topics: codellama, discord, discord-bot, markov-chain, text-generation
- Language: TypeScript
- Homepage:
- Size: 192 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Discord Markov Impostor Bot


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=""
CONNECTION_STRING="" # e.g. "postgres://postgres@localhost:5432/markov", see sequelizer documentation for more options
BOT_OWNER_ID="" # restricts /import command
```
### Import messages
Run `/import \` 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 [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](https://huggingface.co/Phind/Phind-CodeLlama-34B-v2)