{"id":13456120,"url":"https://github.com/TheExplainthis/ChatGPT-Discord-Bot","last_synced_at":"2025-03-24T09:31:31.539Z","repository":{"id":79222111,"uuid":"603631594","full_name":"TheExplainthis/ChatGPT-Discord-Bot","owner":"TheExplainthis","description":"This is a repository that allows you to integrate ChatGPT into Discord.","archived":false,"fork":false,"pushed_at":"2023-04-26T02:51:06.000Z","size":9413,"stargazers_count":592,"open_issues_count":20,"forks_count":1211,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-18T09:10:04.969Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/TheExplainthis.png","metadata":{"files":{"readme":"README.en.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}},"created_at":"2023-02-19T05:06:31.000Z","updated_at":"2025-03-16T16:29:59.000Z","dependencies_parsed_at":"2024-01-13T17:48:31.286Z","dependency_job_id":"83e4e788-9d6d-4456-aca0-572144b97ae4","html_url":"https://github.com/TheExplainthis/ChatGPT-Discord-Bot","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheExplainthis%2FChatGPT-Discord-Bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheExplainthis%2FChatGPT-Discord-Bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheExplainthis%2FChatGPT-Discord-Bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheExplainthis%2FChatGPT-Discord-Bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TheExplainthis","download_url":"https://codeload.github.com/TheExplainthis/ChatGPT-Discord-Bot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245243293,"owners_count":20583602,"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":[],"created_at":"2024-07-31T08:01:16.465Z","updated_at":"2025-03-24T09:31:28.326Z","avatar_url":"https://github.com/TheExplainthis.png","language":"Python","funding_links":["https://www.buymeacoffee.com/explainthis"],"categories":["Python"],"sub_categories":[],"readme":"# ChatGPT Discord Bot\n\n[中文](README.md) | English\n\n[![license](https://img.shields.io/pypi/l/ansicolortags.svg)](LICENSE) [![Release](https://img.shields.io/github/v/release/TheExplainthis/ChatGPT-Discord-Bot)](https://github.com/TheExplainthis/ChatGPT-Discord-Bot/releases/)\n\n\nChatGPT is integrated with Discord, allowing teams to collaborate, communicate, and be more efficient. By following the installation steps below, you too can import ChatGPT into your Discord.\n\n## Update\n- 2023/03/03 Model change to chat completion: `gpt-3.5-turbo`\n\n## Introduction\nBy importing the ChatGPT bot into every channel on Discord, simply enter `/chat` in the input box and the keyword `/chat message` will automatically be inserted. You can then enter text to interact with ChatGPT, as shown in the figure below:\n![Demo](https://github.com/TheExplainthis/ChatGPT-Discord-Bot/blob/main/demo/chatgpt-discord-bot-en.gif)\n\n## Installation Steps\n### Obtaining Tokens\n- Get the API Token given by OpenAI:\n    1. Register/login to your account on [OpenAI](https://beta.openai.com/) platform\n    2. There is a profile picture in the upper right corner. Click on it and select `View API keys`.\n    3. Click on `Create new secret key` in the middle.\n    - Note: Each API has a free quota and restrictions. For details, please see [OpenAI Pricing](https://openai.com/api/pricing/).\n- Obtain Discord Token:\n    1. Log in to [Discord Developer](https://discord.com/developers/applications)\n    2. Create a bot:\n        1. Enter the left side `Applications`\n        2. Click `New Application` in the upper right corner and enter the name of the bot \u003e After confirmation, enter the new page.\n        3. Click on the left side `Bot`\n        4. Click on the right side `Add Bot`\n        5. `MESSAGE CONTENT INTENT` below needs to be turned on\n        6. Click `Save Change`\n        7. The token can be viewed by selecting `View Token` on the top or it will be a `Reset Token` button if it has already been applied.\n    3. Set up OAuth2\n        1. Click on `OAuth2` in the left column\n        2. Click on `URL Generator` in the left column\n        3. In the right column, select bot under `SCOPES` and select `Administrator` under `BOT PERMISSIONS` at the bottom right\n        4. Copy the URL at the bottom and paste it into your browser\n        5. Choose the server you want to add the bot to\n        6. Click `Continue` \u003e `Authorize`\n\n### Project Setup\n1. Fork the Github project:\n    1. Register/login to [GitHub](https://github.com/)\n    2. Go to [ChatGPT-Discord-Bot](https://github.com/TheExplainthis/ChatGPT-Discord-Bot)\n    3. Click `Star` to support the developer\n    4. Click `Fork` to copy all the code to your own repository\n2. Deployment (free space):\n    1. Go to [replit](https://replit.com/)\n    2. Click `Sign Up` and sign in directly with your `Github` account and authorize -\u003e click `Skip` to skip the initialization setup\n    3. In the middle of the homepage, click `Create` -\u003e a dialog box will appear, click `Import from Github` in the upper right corner\n    4. If you haven't added your Github repository yet, click the link `Connect GitHub to import your private repos.` -\u003e check `Only select repositories` -\u003e choose `ChatGPT-Discord-Bot`\n    5. Go back to step 4, at this point, the `Github URL` can choose the `ChatGPT-Discord-Bot` project -\u003e click `Import from Github.`\n\n### Project Execution\n1. Environment variable settings\n    1. After completing the previous step of importing, click on `Tools` at the bottom left of the `Replit` project management page, then click on `Secrets`.\n    2. After clicking `Got it` on the right side, you can add environment variables, which need to be added:\n        1. OpenAI API Token:\n            - key: `OPENAI_API`\n            - value: `[obtained from step one above] sk-FoXXXX`\n        2. Desired model:\n            - key: `OPENAI_MODEL_ENGINE`\n            - value: `gpt-3.5-turbo`\n        3. ChatGPT wants the assistant to play the role of a keyword (currently, no further usage instructions have been officially released, and players can test it themselves).\n            - key: `SYSTEM_MESSAGE`\n            - value: `You are a helpful assistant.`\n        4. Discord Token:\n            - key: `DISCORD_TOKEN`\n            - value: `[obtained from step one above] MTA3NXXX`\n2. Start execution\n    1. Click `Run` at the top\n    2. After successful execution, the right-hand screen will display `Hello. I am alive!`, and **copy the URL** in the upper right corner of the screen, which will be used in the next step\n    - Note: if there are no requests within an hour, the program will stop running, so the next step is needed\n3. CronJob periodic request sending\n    1. Register/login to [cron-job.org](https://cron-job.org/en/)\n    2. Select `CREATE CRONJOB` in the upper right corner of the backend\n    3. Enter `ChatGPT-Discord-Bot` for `Title` and enter the URL from the previous step for URL\n    4. Set it to run every `5 minutes`\n    5. Click on `CREATE`\n\n\n## Commands\n| Command | Description |\n| --- | ----- |\n| `/chat` |  Type `/chat` in the input box followed by `message` to call the ChatGPT model and generate text.|\n| `/reset` | ChatGPT remembers the last ten questions and answers. Calling this command will clear the history.|\n| `/imagine` | Type `/imagine` in the input box followed by `prompt` to call the DALL·E 2 model and generate an image.|\n\n## Support Us\nLike this free project? Please consider [supporting us](https://www.buymeacoffee.com/explainthis) to keep it running.\n\n[\u003ca href=\"https://www.buymeacoffee.com/explainthis\" target=\"_blank\"\u003e\u003cimg src=\"https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png\" height=\"45px\" width=\"162px\" alt=\"Buy Me A Coffee\"\u003e\u003c/a\u003e](https://www.buymeacoffee.com/explainthis)\n\n## Related Projects\n- [chatGPT-discord-bot](https://github.com/Zero6992/chatGPT-discord-bot)\n\n## License\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTheExplainthis%2FChatGPT-Discord-Bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FTheExplainthis%2FChatGPT-Discord-Bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTheExplainthis%2FChatGPT-Discord-Bot/lists"}