{"id":19279631,"url":"https://github.com/4cecoder/chatgpt-cord","last_synced_at":"2025-02-23T21:44:02.441Z","repository":{"id":133201493,"uuid":"610340131","full_name":"4cecoder/chatgpt-cord","owner":"4cecoder","description":"Real ChatGPT Discord bot \u003cFree\u003e","archived":false,"fork":false,"pushed_at":"2023-03-06T16:41:35.000Z","size":90,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-05T16:30:09.275Z","etag":null,"topics":["chatgpt","discord-bot","python"],"latest_commit_sha":null,"homepage":"","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/4cecoder.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":"2023-03-06T15:21:01.000Z","updated_at":"2023-09-13T12:36:43.000Z","dependencies_parsed_at":"2023-04-13T18:32:57.954Z","dependency_job_id":null,"html_url":"https://github.com/4cecoder/chatgpt-cord","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/4cecoder%2Fchatgpt-cord","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4cecoder%2Fchatgpt-cord/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4cecoder%2Fchatgpt-cord/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4cecoder%2Fchatgpt-cord/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/4cecoder","download_url":"https://codeload.github.com/4cecoder/chatgpt-cord/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240385198,"owners_count":19792980,"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":["chatgpt","discord-bot","python"],"created_at":"2024-11-09T21:15:53.200Z","updated_at":"2025-02-23T21:44:02.424Z","avatar_url":"https://github.com/4cecoder.png","language":"Python","readme":"![](https://github.com/user/banner.jpg)\n\n# ChatGPT-Cord\n\n[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://www.buymeacoffee.com/4cecoder)\n\n![image](https://user-images.githubusercontent.com/88108711/223172044-a1af5641-a540-4763-bb28-39265db8c5ec.png)\n\nChatGPT-Cord is a Discord chatbot powered by OpenAI's ChatGPT API.\n\nIt can be used to generate human-like responses to user queries and engage in natural language conversations.\n\n## Usage\n\nTo use ChatGPT-Cord, simply type the command \"!ask\" followed by your question or statement in a Discord chat channel where the bot is present. For example:\n\n `!ask What is the capital of France?`\n\nThe bot will then process your input and generate a response based on its training and context. The response will be posted in the same channel where the command was issued.\n\n## Configuration\n\n1. Create account on [OpenAI's ChatGPT](https://chat.openai.com/)\n2. Save your email and password\n3. Save this as `$HOME/.config/revChatGPT/config.json`\n4. If you are using Windows, you will need to create an environment variable named ```HOME``` and set it to your home profile for the script to be able to locate the config.json file.\n\n### authentication config file location\n\n`mkdir -p ~/.config/revChatGPT/ \u0026\u0026 touch ~/.config/revChatGPT/config.json`\n\n### Next add one of the following methods to link your OPENAI Account to the `~/.config/revChatGPT/config.json`\n\n### Authentication method: (Choose 1)\n#### - Email/Password\nNot supported for Google/Microsoft accounts\n```json\n{\n  \"email\": \"email\",\n  \"password\": \"your password\"\n}\n```\n#### - Session token\nComes from cookies on chat.openai.com as \"__Secure-next-auth.session-token\"\n\n```json\n{\n  \"session_token\": \"...\"\n}\n```\n#### - Access token\nhttps://chat.openai.com/api/auth/session\n```json\n{\n  \"access_token\": \"\u003caccess_token\u003e\"\n}\n```\n\n#### - Optional configuration:\n\n```json\n{\n  \"conversation_id\": \"UUID...\",\n  \"parent_id\": \"UUID...\",\n  \"proxy\": \"...\",\n  \"paid\": false\n}\n```\n\n## Installation\n\nTo use ChatGPT-Cord, you will need to create a Discord bot account and obtain its token. You will also need to have Python 3.6 or higher installed on your system.\n\n1. Clone this repository to your local machine.\n2. Install the required Python packages by running the following command in the terminal:\n\n`git clone https://github.com/4cecoder/chatgpt-cord/`\n\n`pip install -r requirements.txt`\n\n\n3. Set the environment variable `DISCORD_TOKEN` to the token of your Discord bot account.\n\nAn `.env` file needs to be created within the same directory as chatgpt-cord/main.py\n\nand has to have `DISCORD_TOKEN=\u003cpaste your bot token\u003e` for your bot\n\n\n# To create a Discord bot, follow these steps:\n\n    Create a Discord account or log in to your existing account at https://discord.com/.\n\n    Go to the Discord Developer Portal at https://discord.com/developers/applications and click on \"New Application\" to create a new application.\n\n    Give your application a name and click on \"Create\".\n\n    On the next page, click on \"Bot\" in the left sidebar and then click on \"Add Bot\" to create a bot user for your application.\n\n    Customize your bot user's name and avatar if desired.\n\n    Copy the bot token by clicking on \"Copy\" under the \"Token\" section. Keep this token secret and do not share it with anyone.\n\n    Invite your bot to a Discord server by replacing CLIENT_ID in the following link with your application's Client ID, which can be found under the \"General Information\" section:\n\n\n4. Run the bot by executing the following command in the terminal:\n\n`python main.py`\n\nThe bot will start listening for commands in all channels it has access to.\n\n## Credits\n\n- ChatGPT-Cord was created by [4cecoder](https://github.com/4cecoder/) and is based on the OpenAI GPT 3.5 language model. \n- ChatGPT-Cord would not be possible without the incredible natural language processing capabilities of the [OpenAI](https://openai.com/) ChatGPT model. We are grateful for their contributions to the field of AI and machine learning.\n- Thanks to [Antonio Cheong](https://github.com/acheong08) who reverse engineered the chatGPT API.\n- Thanks to [Rajtilak Bhattacharjee](https://github.com/rajtilakjee) for good documentation sections that I borrowed.\n\n## Support\n\nIf you have any questions, issues, or suggestions for improvement, please feel free to open an issue in the GitHub repository or contact me directly. \n\nThanks for using ChatGPT-Cord!\n\n### Licence\n\nMIT license with exceptions. See the full license for details.\n\nCopyright (c) 2023-present, Rajtilak Bhattacharjee\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","funding_links":["https://www.buymeacoffee.com/4cecoder"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F4cecoder%2Fchatgpt-cord","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F4cecoder%2Fchatgpt-cord","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F4cecoder%2Fchatgpt-cord/lists"}