Skip to content

Commit 375f4bd

Browse files
authored
Updated install instructions
1 parent 30cd60d commit 375f4bd

File tree

1 file changed

+24
-6
lines changed

1 file changed

+24
-6
lines changed

README.md

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,35 @@ Go CLI to fuels a Telegram bot that lets you interact with [ChatGPT](https://ope
66

77
## Installation
88

9-
Download the file corresponding to your OS in the [releases page](https://github.com/m1guelpf/chatgpt-telegram/releases/latest). After you extract it, copy `env.example` to `.env` and fill in your Bot's details (you'll need your bot token, which you can find [here](https://core.telegram.org/bots/tutorial#obtain-your-bot-token), and optionally your telegram id, which you can find by DMing `@userinfobot` on Telegram.
9+
Download the file corresponding to your OS in the [releases page](https://github.com/m1guelpf/chatgpt-telegram/releases/latest):
1010

11-
## Usage
11+
- `chatgpt-telegramer-Darwin-amd64`: macOS (Intel)
12+
- `chatgpt-telegram-Darwin-arm64`: macOS (M1)
13+
- `chatgpt-telegram-Linux-amd64`: Linux
14+
- `chatgpt-telegram-Linux-arm64`: Linux (ARM)
15+
- `chatgpt-telegram-Win-amd64`: Windows
1216

13-
Run the `chatgpt-telegram` binary!
17+
After you download the file, extract it into a folder and open the `env.example` file with a text editor and fill in your credentials. You'll need your bot token, which you can find [here](https://core.telegram.org/bots/tutorial#obtain-your-bot-token), and optionally your telegram id, which you can find by DMing `@userinfobot` on Telegram. Save the file, and rename it to `.env`.
1418

15-
## Browserless Authentication
19+
> **Note** Make sure you rename the file to _exactly_ `.env`! The program won't work otherwise.
1620
17-
By default, the program will launch a browser for you to sign into your account. If for whatever reason this isn't possible (compatibility issues, running on a server without a screen, etc.), you can manually provide your cookie.
21+
Finally, open the terminal in your computer (if you're on windows, look for `PowerShell`), navigate to the path you extracted the above file (you can use `cd dirname` to navigate to a directory, ask ChatGPT if you need more assistance 😉) and run `./chatgpt-telegram`.
1822

19-
To do this, first sign into ChatGPT on your browser, then open the Developer Tools, go to the Cookies section in the Application tab, and copy the value of the `__Secure-next-auth.session-token` cookie. Then, create a JSON file in your config dir (`/Users/[username]/Library/Application Support/chatgpt.json` in macOS, `C:\Users\[username]\AppData\Roaming\chatgpt.json` in Windows, `~/.config/chatgpt.json` in Linux), and write your cookie in the following format: `{ "openaisession": "YOUR_COOKIE_HERE" }`.
23+
## Authentication
24+
25+
By default, the program will launch a browser for you to sign into your account, and close it once you're signed in. If this setup doesn't work for you (there are issues with the browser starting, you want to run this in a computer with no screen, etc.), you can manually extract your session from your browser instead.
26+
27+
To do this, first sign into ChatGPT on your browser, then open the Developer Tools (right click anywhere in the page, then click "Inspect"), click on the Application tab and then on the Cookies section, and copy the value of the `__Secure-next-auth.session-token` cookie.
28+
29+
You will then have to create a config file in the following location depending on your OS (replace `YOUR_USERNAME_HERE` with your username:
30+
31+
- `~/.config/chatgpt.json`: Linux
32+
- `C:\Users\YOUR_USERNAME_HERE\AppData\Roaming\chatgpt.json`: Windows
33+
- `/Users/YOUR_USERNAME_HERE/Library/Application Support/chatgpt.json`: macOS
34+
35+
> **Note** If you have already run the program, the file should exist but be empty. If it doesn't exist yet, you can either run the program or manually create it.
36+
37+
Finally, add your cookie to the file and save it. It should look like this: `{ "openaisession": "YOUR_COOKIE_HERE" }`.
2038

2139
## License
2240

0 commit comments

Comments
 (0)