Giter VIP home page Giter VIP logo

chatgpt-telegram-bot's Issues

Implementing an prompt

Would be very useful to have a prompt system that allows you to set the tone of the assistant.

Something that allows us to kick conversations off with some of the settings we prefer. For example I would have:

'prompt': 'You are a helpful assistant. You always convert imperial to metric measurements and localise spelling to the United Kingdom'

Azure TTS, Enhanced Logging and Better Structured Config

This branch is a mess😫.

I implemented several features in one branch and this branch will include:

  1. Azure TTS support when chat with voice.
  2. I don't like Python's logging lib, do it on my own!
  3. The current config key has not been carefully considered, and we have implemented a better structured config.

Error in TG lib when starting

I followed your procedures on an ARM based Oracle VPS but received the following error.

$ python3 telegram_message_parser.py
Traceback (most recent call last):
File "telegram_message_parser.py", line 15, in
from telegram import Update
ImportError: cannot import name 'Update' from 'telegram' (/home/ubuntu/.local/lib/python3.8/site-packages/telegram/init.py)

I am using 3.8.10 python

$ py --version
Python 3.8.10

I fixed it by force removing ~/.local/lib/python3.8/site-packages/telegram and force reinstalling
$ pip install python-telegram-bot --force-reinstall and it fixed the issue

Suggestion: Multi-User Support

One of my use cases is basically running another instance for my friends to use as a telegram bot. It would be helpful to have a way to ‘whitelist’ all telegram IDs so as long as they know the link to message it, they can talk to the bot.

Related to this too, not sure how feasible it is, would be separate conversational context for each person that messages the bot, but I’m also not sure if this is even possible with the API.

Settings

"Would like to see output settings, for example, to display code in monospace font so that it can be easily copied by click. Also, it would be useful to have a feature to output text as an image."

Example:

/settings

  • Settings Menu
    *Picture mode- Off
    *Monospace font - On

It doesn't work for me in Docker Desktop (Windows 10)

2023-03-16 01:11:04 Bot has been started successfully 2023-03-16 01:11:06 Bot has been started successfully 2023-03-16 01:11:07 Bot has been started successfully

Always restart...

image
image
image
image
image

`C:\Users\Asus\Python\chatgpt-telegram-bot>docker compose up -d
[+] Running 0/1

  • chatgpt-bot Warning 2.0s
    [+] Building 25.1s (10/10) FINISHED
    => [internal] load build definition from Dockerfile 0.1s
    => => transferring dockerfile: 288B 0.0s
    => [internal] load .dockerignore 0.0s
    => => transferring context: 34B 0.0s
    => [internal] load metadata for docker.io/library/python:3.11-alpine 1.3s
    => [1/5] FROM docker.io/library/python:3.11-alpine@sha256:741e650697a506f0991ef88490320dee59f9e68de61734e034aee11d2f3baedf 3.1s
    => => resolve docker.io/library/python:3.11-alpine@sha256:741e650697a506f0991ef88490320dee59f9e68de61734e034aee11d2f3baedf 0.1s
    => => sha256:21c32060d5e22e4292410288a34314f9ab518a5df218e906f3387e7f5690eb2c 230B / 230B 0.8s
    => => sha256:8ced40fb1e4201d32de2f1b782b4becf1a5ec8a75406514af9e9898d6f551b68 3.06MB / 3.06MB 1.7s
    => => sha256:741e650697a506f0991ef88490320dee59f9e68de61734e034aee11d2f3baedf 1.65kB / 1.65kB 0.0s
    => => sha256:4b7bbe66de3c3ff042f0a81fd3c20f993acccf08e3eb722f992a585e00594ca9 1.37kB / 1.37kB 0.0s
    => => sha256:7bc17fb245bdf26df10196ea0ab7cb4c1dbbe6d7915f2ac301cdc52e2d91b067 7.34kB / 7.34kB 0.0s
    => => sha256:0b05af06b5194af09bda2ee287f02f887ab50cb3d3434a7d20f67f1af345bfed 12.46MB / 12.46MB 1.6s
    => => extracting sha256:0b05af06b5194af09bda2ee287f02f887ab50cb3d3434a7d20f67f1af345bfed 0.6s
    => => extracting sha256:21c32060d5e22e4292410288a34314f9ab518a5df218e906f3387e7f5690eb2c 0.0s
    => => extracting sha256:8ced40fb1e4201d32de2f1b782b4becf1a5ec8a75406514af9e9898d6f551b68 0.4s
    => [internal] load build context 0.1s
    => => transferring context: 3.44kB 0.0s
    => [2/5] WORKDIR /app 0.5s
    => [3/5] COPY requirements.txt requirements.txt 0.1s
    => [4/5] RUN pip install -r requirements.txt 18.4s
    => [5/5] COPY . . 0.3s
    => exporting to image 1.0s
    => => exporting layers 1.0s
    => => writing image sha256:e3aa5110d002c34767cdefd3c60874e6e4fd762267f44f0adf67041b107f85e4 0.0s
    => => naming to docker.io/chatgpt/bot 0.0s
    [+] Running 2/2
  • Network chatgpt-telegram-bot_default Created 0.8s
  • Container chatgpt-bot Started 1.5s

C:\Users\Asus\Python\chatgpt-telegram-bot>`

I use the latest version 1.2.2

What I did wrong?
How can I fix it?

PS: Thank you for your work!

telegram bot reply nothing

I followed the prompts in the instructions for installation, and at the end it showed that the bot has started successfully. However, I'm not receiving any replies from the bot when I send messages to it. I don't know why.

Add the ability to change the role please

I can't write code, but I would like to add the function of changing the role by the command directly in the code, because if you specify the role in the chat, he does not really want to match it

Access manager has been derived from Telegram APIs

Access manager has been derived from Telegram APIs in new branch accessmanager-dev. Please help me test it. Thx. @flynnoct

In case of granting users different authority between text, voice and file, the <chat_type> field is currently reserved for future use.

How can I change the model and temperature?

I modified line 31 and 41 in openai_parser.py, replaced gpt-3.5-turbo-0301 with gpt-3.5-turbo, and restart the bot, I found it on OpenAI daily usage breakdown page the bot still using model gpt-3.5-turbo-0301. How can I change the model? Thanks.

v1.2.2 to v1.3.0. Backward compatibility

After updating from version 1.2.2 to 1.3.0, the bot stopped responding. I discovered that new parameters were added to the config.json file. The bot did not work until I added the following new parameters:

  • "openai_timeout"
  • "enable_custom_system_role"
  • "system_role"

Perhaps default values for these parameters should be used if they do not exist.

Bot Unresponsive

I have installed and configured the config.json with my api key and bot key. I run the bot on terminal and it says the bot has started, but when I try to interact with the bot in telegram it does nothing.

[suggestion]change the key value of ChatGPT through command line

It would be great if we could change the key value of ChatGPT through command line, such as typing (or selecting) [change key value] in the terminal, and then inputting the new key to update the key value in the configuration file, which would be more convenient than editing the config file manually.😄

Amazing!

First of all, fantastic work. This thing is by far the best I've used. Not sure how you were able to push specific tasks to the background and still communicate with it, but I love it!

I did want to ask about the models. I noticed you were using gpt-3.5-turbo-0301. I'm not familiar with it. Can you explain why that one and not the normal 3.5 turbo?

Also, I tried swapping to text-davinci-003 and 002, but I got a URL error. I assume it just means the wrong syntax is being used to call the API. Is there any way to set it up to utilize older models? I've found that 002 works much better with coding than the newer ones.

Audio interaction does not work

I have used command pip install ffmpeg-python to get ffmpeg installed, and have set enable_voice to true, after I restarted the bot, the audio interaction still does not work, anything wrong I did?

Single Message Mode

  • Implemented a single message mode with no context provided to save tokens in some scenarios.

Suddenly No Response from Bot?

It’s been working fine for the past few days but suddenly I’m not getting any responses from the bot, even after restart_bot.sh and a server reboot. Are there any further steps I can take for troubleshooting?

Thank you.

No perceptual clear the conversation context

This model's maximum context length is 4096 tokens. However, your messages resulted in 4119 tokens. Please reduce the length of the messages. Sorry, I am not feeling well. Please try again.

After exceeding the limit of tokens, we can only execute /clear to clear conversation context to restore function.

This seems to be the only option, so is it possible that sending the message again after reaching the limit will automatically execute the /clear command?

Why do we need to copy a config.json file?

Hello author, I have a question to ask. Why do we need to copy a config.json file through command during installation? Why not directly provide it in the program code? If it is provided directly, the user would have one less step during installation. I am not a programmer, just curious.Thank you for providing such an interesting project.😄

bot not responding

I tried main and dev and they both have the same problem.

When using start_bot.sh, although it says bot started successfully, it cannot get a response after sending a message through Telegram Bot.

When starting telegram_message_parser.py with the python command, the following error is encountered.

Traceback (most recent call last): File "/home/src/telegram_message_parser.py", line 15, in <module> from telegram.ext import ApplicationBuilder, CommandHandler, MessageHandler, InlineQueryHandler, ChosenInlineResultHandler, ContextTypes, filters ModuleNotFoundError: No module named 'telegram'

Add TTS feature to reply voice messages with Amazon Polly

Any possible to add text-to-speech feature to the bot? For example, with Amazon Polly, we could get 5 million characters free per month for 12 months with the AWS Free Tier. https://aws.amazon.com/polly/

This feature could allow the bot to reply voice messages to users. This could make the bot more powerful, for example for language learning, etc.

how to get working

ok its not my first time working with ai bots, iv followed all the instructions and ran it and nothing happens it wont responed or anything.

help

Please help me to integrate to telegram, bot started, but telegram bot doesnt working:(

Refactor code: privacy, better hierarchy & logging

It's Flynn here, I'm glad to show you what I plan to do now.

  1. Previously, we ask for @your_bot_name <your messages> in a group chat to make the bot reply. And the Privacy Mode needs to be disabled to make the bot have ability to get ALL messages from a group. We reviewed that requirement and we think it could be a privacy concern for some users (but I promise we didn't, and won't save your chat history for any other use). Therefore, in next version, the way to chat with the bot in a group chat is to use a specific command /chat. Privacy is basic rights, we hope you like this changes.
  2. This bot is started with a small set of features. However there are so many features we like (more on the way!) come to life. It's necessary for us to refactor hierarchy for this project and make everyone's life easier. XD
  3. The We apologize for not having good Ioggings at the beginning and causes someone's confusion. We are going to add loggings into our code and diagnosis could be much easier later.

Good night. See you soon.

Got no response from my bot

wget command didn't work for me, so I used git clone to pull the source code, and I got all dependencies installed, sure, replaced the api key and bot token and got it running on my Azure WM, but I still got no response from my bot.

Bot does not respond.

After running the command 'bash ./bin/start_bot.sh', my terminal displays the message 'Bot has been started successfully', but when I try to chat with the bot on Telegram, it doesn't respond. How can I fix this issue?
ảnh

Would you consider synchronizing to HubDocker?

There are many users there, and it can be loved by more people.

For example, on Synology devices, it only supports the use of HubDocker for installation.

If you can synchronize to HubDocker, it's really great.

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.