{"id":19276119,"url":"https://github.com/trojaner/markovbot","last_synced_at":"2025-04-21T23:30:56.437Z","repository":{"id":83443947,"uuid":"575165565","full_name":"Trojaner/MarkovBot","owner":"Trojaner","description":"Impersonate any user by generating random messages in their unique writing style","archived":false,"fork":false,"pushed_at":"2024-03-26T10:25:16.000Z","size":197,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-01T16:52:46.833Z","etag":null,"topics":["codellama","discord","discord-bot","markov-chain","text-generation"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Trojaner.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-06T22:40:29.000Z","updated_at":"2024-05-13T14:36:18.000Z","dependencies_parsed_at":"2024-03-25T20:31:06.851Z","dependency_job_id":"fe897a3a-dcf6-45d2-a9de-0e44d3cf30bd","html_url":"https://github.com/Trojaner/MarkovBot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Trojaner%2FMarkovBot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Trojaner%2FMarkovBot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Trojaner%2FMarkovBot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Trojaner%2FMarkovBot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Trojaner","download_url":"https://codeload.github.com/Trojaner/MarkovBot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250150602,"owners_count":21383195,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["codellama","discord","discord-bot","markov-chain","text-generation"],"created_at":"2024-11-09T20:52:55.008Z","updated_at":"2025-04-21T23:30:56.058Z","avatar_url":"https://github.com/Trojaner.png","language":"TypeScript","readme":"# Discord Markov Impostor Bot\r\n\r\n![image](https://github.com/Trojaner/MarkovBot/assets/1809172/82320a9e-0390-45b4-8826-f5f0b31b30a3)\r\n![image](https://github.com/Trojaner/MarkovBot/assets/1809172/e050de91-a376-41f7-9f24-f34621131ffc)\r\n\r\n\r\nThis bot can impersonate any Discord user's unique writing style. It can generate text based on prompts or it can be completely random.\r\n\r\nAs 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.\r\n\r\n## Required permissions / intents\r\n\r\nThe bot needs the \"Message Content\" intent as it must be able to grab new messages.\r\nIt also needs the following permissions:\r\n\r\n- Read Messages/View Channels\r\n- Send Messages\r\n- Read Message History\r\n- Manage Webhooks for channels where it can auto-reply or impersonate users\r\n\r\n## How to run\r\n\r\n### Setting up the database\\*\\*\r\n\r\nRun the migration.sql file inside the db folder. If you are not using postgresql create a similar table manually instead.\r\n\r\n### Setting up the environment\r\n\r\nCreate an .env file in the project's root directory with the following content (or pass as environment variables):\r\n\r\n```\r\nDISCORD_CLIENT_TOKEN=\"\u003cyour token\u003e\"\r\nCONNECTION_STRING=\"\u003cconnection string\u003e\" # e.g. \"postgres://postgres@localhost:5432/markov\", see sequelizer documentation for more options\r\nBOT_OWNER_ID=\"\u003cyour discord id\u003e\" # restricts /import command\r\n```\r\n\r\n### Import messages\r\n\r\nRun `/import \\\u003cchannel\\\u003e` to import messages from a channel.  \r\nThe more messages you have, the better the results are. Avoid importing gibberish from e.g. #bot-commands channels.  \r\nRegardless of that the bot will try to filter out unparsable messages like links or messages that seem like bot commands.\r\n\r\n## Using the bot\r\n\r\n### Impersonate Users\r\n\r\nAfter importing you can impersonate any user using the `/impersonate \u003cuser\u003e [query]` command.  \r\nThe query parameter is optional and can be a word that the generated message should start with.\r\n\r\n### Hive Mind\r\nYou can also use `/hive [query]` where the bot impersonates the whole discord server as if it was a single person.\r\n\r\n## Todo:\r\n\r\n- Dockerfile\r\n- Periodic auto importing of messages\r\n- Randomly reply as random user (to questions?)\r\n\r\n## Credits:\r\nThe markov chain implementation is a modified version of code generated by [Phind-CodeLlama 34B](https://huggingface.co/Phind/Phind-CodeLlama-34B-v2)\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrojaner%2Fmarkovbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrojaner%2Fmarkovbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrojaner%2Fmarkovbot/lists"}