Skip to content

Dewdrop is a Telegram ChatGPT bot, written in python, based on pyrogram

License

Notifications You must be signed in to change notification settings

Leoksu/DewChatGPT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dewdrop

Ghouls

Telegram chat bot with OpenAI API using GPT-3 engine based on pyrogram

A simple version of Dewdrop, bcz I lazy to finish that

Demo

  • You can try this bot for better understanding the function of this bot

Features

List to-do

  • Use normal AI chat bot for main and /ask command for ChatGPT.
  • Add jokes, story, weather, and some fun modules.
  • Image recognition.

Variables

  • API_ID & API_HASH - Get this from my.telegram.org
  • BOT_TOKEN - Visit @BotFather and send /newbot. You will see instructions to create a new bot.
  • API_KEY - First you need to create OpenAI account, and click this to create new api key.
  • USERNAME - Your bot username without @.

Bcz I getting confused with Client.get_me(), so you need to put bot username manually, will very thanks if someone want to help me.

Deployment

  • Run locally VPS:
  1. Always update before do anything
apt-get update && apt-get upgrade -y
  1. Install python and git module
apt-get install python3 git
  1. Clone this repository
git clone https://github.com/Leoksu/DewChatGPT && cd DewChatGPT
  1. install all required python package
pip3 install -r requirements.txt
  1. Copy sample.env to .env
cp sample.env .env
  1. Fill all variables in .env file with your favorite text editor
    • or just use nano, nano .env
  2. See Here to customize bot text
  3. Use screen or tmux to keep your bot running in background
screen -S dew
  1. Finnaly run the bot
python3 dew.py
  • Then use CTRL+A and CTRL+D to close screen
  • If you want to stop the bot or check logs run screen -r dew

Custom models

  • Default model is text-ada-001 which is faster and cheaper to avoid token limit.
  • See model list and more info in OpenAi site.
  • Go to dew.py file.
def generate_text(prompt):
    data = {
        'prompt': prompt,
        'model': 'text-ada-001', # edit this value to model you want
        'temperature': 0.5,
        'max_tokens': 1024, # you can also change max token in one msg
        'n': 1,
        'stop': None,
        'temperature': 0.9,
        'top_p': 0.3,
        'frequency_penalty': 0.5,
    }
  • That's it, keep in mind that every engine models have different cost, choose the one that suits your needs.

Custom text

  • Set your own start text, help text, and more
  • Simply go to this file and edit it to your desired text

About

Dewdrop is a Telegram ChatGPT bot, written in python, based on pyrogram

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published