{"id":19276124,"url":"https://github.com/trojaner/impostorbot","last_synced_at":"2025-10-18T04:16:32.288Z","repository":{"id":83443953,"uuid":"576737027","full_name":"Trojaner/ImpostorBot","owner":"Trojaner","description":"impersonate any Discord user's unique writing style","archived":false,"fork":false,"pushed_at":"2022-12-16T17:57:57.000Z","size":148,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-01T16:52:48.824Z","etag":null,"topics":["bot","chatgpt","discord","impostor","rnn"],"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-10T20:16:13.000Z","updated_at":"2023-03-07T01:24:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"c48464d9-1a34-4cfe-a60e-ac6c2ff88494","html_url":"https://github.com/Trojaner/ImpostorBot","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%2FImpostorBot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Trojaner%2FImpostorBot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Trojaner%2FImpostorBot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Trojaner%2FImpostorBot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Trojaner","download_url":"https://codeload.github.com/Trojaner/ImpostorBot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250150597,"owners_count":21383194,"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":["bot","chatgpt","discord","impostor","rnn"],"created_at":"2024-11-09T20:52:57.244Z","updated_at":"2025-10-18T04:16:27.256Z","avatar_url":"https://github.com/Trojaner.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Discord Impostor Bot\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\nThis bot is the successor of the [MarkovBot](https://github.com/Trojaner/MarkovBot). The MarkovBot used markov chains for text prediction, which resulted in low quality results.\r\nThis bot uses a recurrent neural network (RNN) with Tensorflow.js instead. The RNN related code was generated by [ChatGPT](https://openai.com/blog/chatgpt/).\r\n\r\n[This prompt](https://github.com/Trojaner/ImpostorBot/blob/master/misc/chatgpt-query.txt) was used to generate the RNN code.\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- 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/bot\", see sequelizer documentation for more options\r\n```\r\n\r\n### Import messages\r\n\r\nImport messages from your text channels. Run `/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**YOU SHOULD AVOID IMPORTING MESSAGES WHEN RUNNING THE BOT ON YOUR OWN COMPUTER. DISCORD WILL RATE-LIMIT YOUR IP ADDRESS FOR A FEW HOURS. YOU WILL NOT BE ABLE TO USE YOUR DISCORD UNTIL THE RATE LIMIT EXPIRES OR YOUR IP ADDRESS CHANGES.**\r\n\r\n## Using the bot\r\n\r\n### Impersonate Users\r\n\r\nAfter importing the messages you can impersonate any user using the `/impersonate \u003cuser\u003e \u003cchannel\u003e [prompt]` command.  \r\nThe prompt parameter is optional and can include a few words that the generated message should start with.\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\n\r\n[ChatGPT](https://openai.com/blog/chatgpt/) for the RNN code.\r\n[GitHub Copilot](https://github.com/features/copilot) for being a helping hand.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrojaner%2Fimpostorbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrojaner%2Fimpostorbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrojaner%2Fimpostorbot/lists"}