Coder Social home page Coder Social logo

chatgpt-telegram's Introduction

Hi there 👋

I'm a 22-year-old maker, and I love building things.

I work at Worldcoin, building the most scalable & private sybil-resistance solution.

In my free time, I like to build. Here's a few of my favourite open-source projects:

  • cog-rust: Rust containers for machine learning.
  • ensemble: A Laravel-inspired ORM for Rust.
  • commit: A command palette-style Git client for blazing-fast commits.
  • lil-web3: Simple, intentionally-limited versions of web3 protocols & apps.
  • auto-commit: Rust CLI that automatically writes commit messages for you, built in Rust.
  • yt-whisper: Automatically generate subtitles for YouTube videos, using OpenAI's Whisper.
  • plz-cli: Copilot for your terminal
  • armchair: A Next.js starter kit for full-stack web3 apps.
  • php-evm: A PHP implementation of the Ethereum Virtual Machine, because why not.
  • connect4-sol: A hyper-optimised Connect 4 implementation on Solidity.
  • ...

chatgpt-telegram's People

Contributors

dhilman avatar lxy1992 avatar m1guelpf avatar mystery00 avatar sebaplaza avatar wisdom-yzh avatar yuldashboev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chatgpt-telegram's Issues

Couldn't edit message: Too Many Requests: retry after 210

When the ChatGPT bot has a long answer, an error message like this appears:
2022/12/11 12:34:58 Couldn't edit message: Too Many Requests: retry after 230
2022/12/11 12:34:59 Couldn't edit message: Too Many Requests: retry after 229
2022/12/11 12:34:59 Couldn't edit message: Too Many Requests: retry after 229
2022/12/11 12:35:00 Couldn't edit message: Too Many Requests: retry after 228
2022/12/11 12:35:00 Couldn't edit message: Too Many Requests: retry after 228
2022/12/11 12:35:01 Couldn't edit message: Too Many Requests: retry after 227
2022/12/11 12:35:01 Couldn't edit message: Too Many Requests: retry after 227
2022/12/11 12:35:02 Couldn't edit message: Too Many Requests: retry after 227
2022/12/11 12:35:02 Couldn't edit message: Too Many Requests: retry after 226
2022/12/11 12:35:03 Couldn't edit message: Too Many Requests: retry after 226
2022/12/11 12:35:03 Couldn't edit message: Too Many Requests: retry after 225
2022/12/11 12:35:04 Couldn't edit message: Too Many Requests: retry after 225
2022/12/11 12:35:05 Couldn't edit message: Too Many Requests: retry after 224
2022/12/11 12:35:05 Couldn't edit message: Too Many Requests: retry after 223
2022/12/11 12:35:05 Couldn't edit message: Too Many Requests: retry after 223
2022/12/11 12:35:06 Couldn't edit message: Too Many Requests: retry after 222
2022/12/11 12:35:06 Couldn't edit message: Too Many Requests: retry after 222
2022/12/11 12:35:07 Couldn't edit message: Too Many Requests: retry after 221
2022/12/11 12:35:07 Couldn't edit message: Too Many Requests: retry after 221
2022/12/11 12:35:08 Couldn't edit message: Too Many Requests: retry after 220
2022/12/11 12:35:08 Couldn't edit message: Too Many Requests: retry after 220
2022/12/11 12:35:09 Couldn't edit message: Too Many Requests: retry after 219
2022/12/11 12:35:09 Couldn't edit message: Too Many Requests: retry after 219
2022/12/11 12:35:10 Couldn't edit message: Too Many Requests: retry after 219
2022/12/11 12:35:10 Couldn't edit message: Too Many Requests: retry after 218
2022/12/11 12:35:11 Couldn't edit message: Too Many Requests: retry after 218
2022/12/11 12:35:11 Couldn't edit message: Too Many Requests: retry after 217
2022/12/11 12:35:11 Couldn't edit message: Too Many Requests: retry after 217
2022/12/11 12:35:12 Couldn't edit message: Too Many Requests: retry after 216
2022/12/11 12:35:12 Couldn't edit message: Too Many Requests: retry after 216
2022/12/11 12:35:13 Couldn't edit message: Too Many Requests: retry after 215
2022/12/11 12:35:13 Couldn't edit message: Too Many Requests: retry after 215
2022/12/11 12:35:14 Couldn't edit message: Too Many Requests: retry after 214
2022/12/11 12:35:15 Couldn't edit message: Too Many Requests: retry after 213
2022/12/11 12:35:15 Couldn't edit message: Too Many Requests: retry after 213
2022/12/11 12:35:16 Couldn't edit message: Too Many Requests: retry after 213
2022/12/11 12:35:16 Couldn't edit message: Too Many Requests: retry after 212
2022/12/11 12:35:17 Couldn't edit message: Too Many Requests: retry after 212
2022/12/11 12:35:17 Couldn't edit message: Too Many Requests: retry after 211
2022/12/11 12:35:18 Couldn't edit message: Too Many Requests: retry after 211
2022/12/11 12:35:18 Couldn't edit message: Too Many Requests: retry after 210

how to make this prog run in background?

fyi
I have an arm vps, ubuntu 22.0. every time I use these two commands below, it will not response.

./chatgpt-telegram &

or

./chatgpt-telegram &>/dev/null &

but, if I just call this command below, it woks like a charm, but, I can't close my ssh session...

./chatgpt-telegram

pls help, thx

Different Panic Error

When trying to run it, the following error message pops up:

_panic: runtime error: index out of range [-1]

goroutine 1 [running]:
main.query_chatgpt({0xc000487e9a, 0x3}, {0x13ceae0, 0xc000072580}, 0x8?, {{0x12e54507c, {0x0, 0x0}, 0x0, {0x0, ...}, ...}, ...})
/github/workspace/main.go:190 +0x9d1
main.main()
/github/workspace/main.go:115 +0xebe_

Does anyone have a Idea of how to fix it?

Thanks in advance!

Couldn't open website: could not send message to server: net::ERR_NAME_NOT_RESOLVED

System: ubuntu 22.04
shell: zsh

2022/12/05 10:29:58 Couldn't open website: could not send message to server: net::ERR_NAME_NOT_RESOLVED at https://chat.openai.com/
=========================== logs ===========================
navigating to "https://chat.openai.com/", waiting until "load"
============================================================

my bot did not response

my bot did not response

release: v0.2

cmd log: 2022/12/07 01:01:10 Please log in to OpenAI Chat

I have log in chatGPT with the launched browser.

chatgpt-telegram.exe window disappears without error message

I recently installed chatgpt-telegram.exe on my Windows10 system computer and was able to successfully sign in OpenAI website. However, after a few seconds the window disappears suddenly without any error message. I'm not sure what's causing this issue or how to fix it.

Also, my .env is configured and get my TELEGRAM_TOKEN writed in it.And I tried run this program with 'Run as administrator'.

Can anyone provide some guidance on what might be happening and how I can troubleshoot this problem?

Thanks in advance for your help.

Failing to Launch Headless Browser in Ubuntu

Overview

Running on ubuntu fails to launch a headless browser with the following message:

[pid=3217614][err] [1204/103930.563367:WARNING:sandbox_linux.cc(377)] InitializeSandbox() called with multiple threads in process gpu-process.
[pid=3217614][err] [1204/103930.531617:FATAL:headless_browser_main_parts.cc(148)] Check failed: result == JsonPrefStore::PREF_READ_ERROR_NO_FILE (4 vs. 6)

Will post a follow-up if I figure out how to fix for posterity.

EDIT_WAIT_SECONDS Doesn't work

This option doesn't seem to work, After I set it up, it will still edit quickly until Too Many Request is triggered when a large piece of text is encountered.
Like this:

2022/12/11 04:33:36 Couldn't edit message: Too Many Requests: retry after 237
2022/12/11 04:33:36 Couldn't edit message: Too Many Requests: retry after 236
2022/12/11 04:33:36 Couldn't edit message: Too Many Requests: retry after 236
2022/12/11 04:33:37 Couldn't perform final edit on message: Too Many Requests: retry after 236

Hitting Telegram rate-limits on message edits

I received the similar error frequently. It seems this bot use the edit message api to send(keep editing one message). When the message is long, the edit action will happen too frequently, then hit the api call rate limit. Hope could replace it by the normal send message.

Error Message:

2022/12/06 09:01:25 Couldn't edit message: Too Many Requests: retry after 30
2022/12/06 09:01:26 Couldn't edit message: Too Many Requests: retry after 29
2022/12/06 09:01:26 Couldn't perform final edit on message: Too Many Requests:

Fixes #28

Inconvenience caused by ChatGPT delay or error reporting

Sometimes ChatGPT will delay to give the user a reply, or sometimes report an error due to network problems. After the error is happend, chatgpt-telegram will still run in the background and will no longer give any response to the user in telegram. I have to restart the chatgpt-telegram program on the server/Laptop/Computer. This has a little troublesome to use, hope it can be fixed, thank you!

show markdown code block style.

fyi
telegram bot repose support markdown style, can you please make the code block of chatgpt response show in telegram chat?

thanks!

Couldn't launch headless browser: could not send message

2022/12/05 14:14:28 Couldn't launch headless browser: could not send message: could not send message to server: Timeout 30000ms exceeded.
=========================== logs ===========================
<launching> /home/berliangur/.cache/ms-playwright/chromium-978106/chrome-linux/chrome --disable-background-networking --enable-features=NetworkService,NetworkServiceInProcess --disable-background-timer-throttling --disable-backgrounding-occluded-windows --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-background-pages --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=ImprovedCookieControls,LazyFrameLoading,GlobalMediaControls,DestroyProfileOnBrowserClose,MediaRouter,AcceptCHFrame,AutoExpandDetailsElement --allow-pre-commit-input --disable-hang-monitor --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-backgrounding --disable-sync --force-color-profile=srgb --metrics-recording-only --no-first-run --enable-automation --password-store=basic --use-mock-keychain --no-service-autorun --export-tagged-pdf --no-sandbox --user-data-dir=/tmp/chatgpt --remote-debugging-pipe about:blank
<launched> pid=24010
============================================================
exit status 1

参考教程,能够顺利运行。但是不能关闭ssh

我是将chatgpt-telegram部署在了vps上,执行./chatgpt-telegram以后bot能够成功运行,但是断开finalshell以后,bot停止工作,需要再次登录vps执行./chatgpt-telegram才能恢复运行。怎么才能保持./chatgpt-telegram持续的运行,目前还在解决中。如果你有更好的注意,请告诉我。

connection reset by peer

Connection was reset by peer. Then I had to restart the chatp-telegram program, and it could work again.

This error occurred very often.

2022/12/08 22:59:08 Post "https://api.telegram.org/bot888888888:Secrete_Token/getUpdates": read tcp 107.182.30.58:46326->149.154.167.220:443: read: connection reset by peer
2022/12/08 22:59:08 Failed to get updates, retrying in 3 seconds...

Does it have something to do with Telegram's offical server or the program needs a proxy to access Telegram?

I saw a pull request about adding socks5 proxy from here: #38

I saw another request about adding http proxy from here: #34

I don't know if there is anyone else who has the same issue like me.

Question about the group function

After I pull the bot into the group, anyone who asks a question, the bot replies "You are not authorized to use this bot.", what is the reason? How can he be used in groups?

How to change the default browser

When logging into my openAI account, my chromium keeps crashing during code running
m-Darwin-arm64/chatgpt-telegram ; exit; 2022/12/05 21:01:00 Please log in to OpenAI Chat
and then, browser crashes

Google auth is broken in chromium that is downloaded.

my open AI account doesn't have a password as I have used google to sign up for the account.
I cannot turn on "less secure apps" because I'm simply not going to remove 2fa on my account.
"cannot sign you in" is the loop i'm stuck in with signing in to google on the downloaded chromium and as mentioned, they'll never give you a password once you've signed up to openapi with Google auth

panic error

I was using the chat with no problem, but then I had two consecutive errors within the chat, it said: "Error: Loading took too long". And after that last one, the terminal stopped running the binary file, and finally spitted out this message.

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x110 pc=0x6aa996]

goroutine 1 [running]:
main.query_chatgpt({0xc000023220, 0x1d}, {0x7d9380, 0xc00030a160}, 0x0?, {{0x6bbf8a, {0x0, 0x0}, 0x0, {0x0, ...}, ...}, ...})
	/github/workspace/main.go:195 +0x4f6
main.main()
	/github/workspace/main.go:115 +0xebe

Browser opens then closes

when I launch ./chatgpt-telegram on Ubuntu 20.04 Desktop the headless browser open, it asks me to login, and before I can click the button to login, the window closes and stays in the following state

0x3639@ubuntu:~/chatgpt-telegram-Linux-amd64$ ./chatgpt-telegram 
2022/12/04 11:21:55 Please log in to OpenAI Chat

Any thoughts on how to get the window to stay open so I can login?

OpenAI API key

Is it possible to use the API key for authentication?
Thanks

Support for multiple cookies

When using one account to ask questions frequently, no reply will be received. Therefore, it is hoped that multiple accounts can be supported and any of the cookies can be used randomly, which may improve the usability of Bot.

Hope to add support for http proxy

In some application environments, I can only connect to the telegram through the proxy. This means that the global proxy needs to be opened, which will affect the running of other programs

Couldn't install headless browser

(base) mike@mikes-mbp chatgpt-telegram-Darwin-arm64 % ./chatgpt-telegram
2022/12/04 17:47:55 Couldn't install headless browser: could not install driver: could not install driver: could not check if driver is up2date: could not run driver: exit status 1

Keep getting stuck on execution, thoughts on what this could be?

You are not authorized to use this bot.

From what I see, this is related to the telegram, but I wonder why I got this You are not authorized to use this bot. even though I already use the token with ID from botFather

Thanks

Screenshot 2022-12-04 at 22 58 59

Some Suggestion about "without session token"

A small suggestion is that maybe this program can use OpenAI's user email and password as a config file, and also maybe can
try to let the program "Automatically grab Session Token", so that it can be used without a session token and without popping up a browser window? Is that OK to be achieved?

And, thank you so much for your contribution!

issue on second run

The first time I ran on M2 Mac, binary ran fine and I was able to log in on Chromium. After I logged in it closed out. I DMd the bot, but it did not successfully reply.

I ran the process over again, with a new bot, and then ran into this error.

Screenshot 2022-12-04 at 1 22 57 AM

What would you advise? Thank you for building this useful tool!

cant find .env file?

for some reason, ti cant finds that file, but its right there in the same directory and its named .env so I'm kinda confused

I try to install on raspberry pi but error.

Couldn't install headless browser: could not install driver: could not install browsers: could not install browsers: exit status 126

Please, any one can help install on raspberry pi ?

`Conflict: can't use getUpdates method while webhook is active [...]`

When running the bot (version 0.2), after logging in via the browser, I get the following output:

2022/12/08 10:17:19 Started ChatGPT
2022/12/08 10:17:19 Started Telegram bot! Message @######### to start.
2022/12/08 10:17:19 Conflict: can't use getUpdates method while webhook is active; use deleteWebhook to delete the webhook first
2022/12/08 10:17:19 Failed to get updates, retrying in 3 seconds...
2022/12/08 10:17:22 Conflict: can't use getUpdates method while webhook is active; use deleteWebhook to delete the webhook first
2022/12/08 10:17:22 Failed to get updates, retrying in 3 seconds...
2022/12/08 10:17:25 Conflict: can't use getUpdates method while webhook is active; use deleteWebhook to delete the webhook first
2022/12/08 10:17:25 Failed to get updates, retrying in 3 seconds...

It just loops over and over and I'm never able to get any answer from my bot in Telegram.

Wrong usage of SSE

Event-stream should be reused.

However, why this project didn't reuse the event-stream connection?

Every time I call SendMessage, it just creates another event-stream, which is inefficient.

This causes a serious problem "Super slow to print out the result from the OpenAI".

I tested it for many times and i believed it was caused by this wrong usage case of SSE.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.