FlamingoFiesta / Chatgpt-Claude_telegram_bot_with_payment_system

A telegram bot that uses the OpenAI and/or the Anthropic API for an improved user experience, with payment system integrated for you to start making money! Please consider starring the repo if you use it!
https://t.me/ChatdudBot
MIT License
3 stars 1 forks source link
anthropic chat chat-gpt chatbot chatgpt chatgpt-api claude-3-opus claude-api docker fork gpt-4o gpt-4o-api gpt-4omni openai payment-integration python stripe-payments telegram telegram-bot

ChatGPT Telegram Bot : No daily limits. Special chat modes.


This repo is a fork based on Karfly's infrastructure, with some added functionalities by me. Please check his repo out, this wouldnt have been possible without him!

This repo is ChatGPT re-created as Telegram Bot, and its 95% ready for you to deploy and potentially earn money

You can deploy your own bot, or use mine: @Chatdud Bot

If you decide to clone the repo and use the bot, please consider starring the project. I would be really greatful! <3

Original features when I started the fork (02.02.2024)

What I added


Upcoming:

Bot commands

Setup

  1. Get your OpenAI API key and/or your (optional) Anthropic API key

  2. Get your Telegram bot token from @BotFather

  3. Get your Stripe secret key (optional if you dont want to use the payment system)

  4. Edit config/config.example.yml to set your tokens, stripe key (if you choose to use stripe), then run the 2 commands below (if you're advanced user, you can also edit config/config.example.env):

    mv config/config.example.yml config/config.yml
    mv config/config.example.env config/config.env
  5. Download and install docker, then open the app.

  6. (Optional) Setup ngrok to automatically update the users balance after payment and send them a confirmation message (ignore this if you dont want to update your balance automatically and in real time, skip to step 7)

    1. Download ngrok:

      • Go to the ngrok website.
      • Click on the download for your operating system.
      • Sign up or log in on the website to get your authentication token (will be refered to as ).
    2. Unzip the folder

    3. Connect your account

      • For MacOS:

        • Open terminal
        • Navigate to the folder where you unziped ngrok (e.g. cd Downloads).
        • Run:
          ./ngrok authtoken <YOUR_AUTH_TOKEN>
        • Keep the terminal window open
      • For Windows:

        • Open Command Prompt.

        • Open terminal and navigate to the folder where you unziped ngrok (e.g. cd Downloads).

        • Run:

          ngrok.exe authtoken <YOUR_AUTH_TOKEN> 
        • Keep the terminal window open

    4. Run ngrok

      • For MacOS:

        • Run:
          ./ngrok http 5000
        • You will see a status screen with the URL next to "Forwarding" in the format of "https://NUMBERS.ngrok-free.app", you will need it in bit
        • Keep the terminal open, ngrok will keep running as long as the terminal window is open.
      • For Windows

        • Run:
          ngrok.exe http 5000
        • You will see a status screen with the URL next to "Forwarding" in the format of "https://NUMBERS.ngrok-free.app", you will need it in bit
        • Keep the terminal open, ngrok will keep running as long as the terminal window is open.
    5. Add the webhook endpoint to the Stripe dashboard

      • Go to the webhook section in your stripe dashboard by following the link or find it under the Developers section
      • Click Add endpoint
      • In the Endpoint URL field, enter the URL you got from ngrok followed by /stripe-webhook
        • For this example it would be https://NUMBERS.ngrok-free.app/stripe-webhook
      • Click +Select events
      • Under the Checkout section, select checkout.session.completed. Now Add event then Add endpoint.
      • Click on Reveal under Signing secret and copy the webhook secret
    6. Edit config/config.yml to set your webhook secret

    7. Please note that the free plan for ngrok gives you a new URL everytime you run the service, which means that you have to keep it running all the time and update the URL in the stripe dashboard if you restart ngrok. For a static domain, you need to have the paid subscription.

    8. Now youre done setting up the payment system, good job!

  7. 🔥 And now, cd to the Chatgpt-Claude_telegram_bot_with_payment_system directory

    • If you use the payment system, run:
    docker-compose --env-file config/config.env up --build
    • If you dont use the payment system, run:
    docker-compose -f docker-compose_nopayment.yml --env-file config/config.env up --build

❤️ Top Donations

If you found my fork useful, use the topup command in my bot for any donations! Send me a message so that I know it was you who donated, you can be on this list:

  1. "." - €10, no special message, but thank you for being the first to donate!

Contributors

References

  1. OpenAI API documentation
  2. Anthropic API documentation
  3. Stripe documentation