Coder Social home page Coder Social logo

chetanxpro / chatgpt-telegram-bot Goto Github PK

View Code? Open in Web Editor NEW
32.0 3.0 26.0 132 KB

A Telegram Chat bot that uses OpenAI Api to send you pictures in addition to responding to your questioins

License: MIT License

JavaScript 100.00%
nodejs telegram-bot telegram-chat-bot chatgpt gpt-3 bot telegram openai openai-api

chatgpt-telegram-bot's Introduction

Chatgpt telegram bot

How to install this bot ?

  • If You want to use extra features like speech service and database to store active users then use Master branch (You have to enter mongoDb connection url in .env)

  • Or if you dont want to use database then checkout to bot-without-monogdb branch (no need to enter monogoDB connection url in .env)

  • Clone This repo

  • Create .env file in root

  • Enter Your API keys in .env files

  • To install all modules npm install

  • To run developer server npm run dev

Env

  • API=<YOUR_OPENAI_API>

  • TG_API=<YOUR_TELEGRAM_BOT_API>

  • Need only if you want to use Text to Audio feature

  • AZURE_API=<YOUR_AZURE_TEXT_TO_AUDIO_API>

  • Need only if you want to save data to mongo Database

  • URI=<YOUR_MONOGDB_URI>

Commands

/ask <YOUR_QUESTION>

  • With this command you can ask anything from bot.
  • ex-> /ask what is utf-8 encoding

/speech <YOUR_TEXT>

  • Bot will generate Audio for your text
  • ex-> /speech hi how are you

/image <IMAGE_DESCRIPTION>

  • You can give a description to generate an image
  • ex-> /image A dog on moon.

/en <YOUR_WRONG_GRAMMAR_ENGLISH>

  • You can send your sentence with wrong grammar bot will fix that.
  • /en i am going in my house roof

chatgpt-telegram-bot's People

Contributors

chetanxpro 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

Watchers

 avatar  avatar  avatar

chatgpt-telegram-bot's Issues

Telegram Error 404 not found

This is what i get when i run your script:

`──(root㉿kali)-[/home/alessandro/Scrivania/chatgpt-telegram-bot]
└─# npm start

[email protected] start
node index.js

/home/alessandro/Scrivania/chatgpt-telegram-bot/node_modules/telegraf/lib/core/network/client.js:293
throw new error_1.default(data, { method, payload });
^

TelegramError: 404: Not Found
at Telegram.callApi (/home/alessandro/Scrivania/chatgpt-telegram-bot/node_modules/telegraf/lib/core/network/client.js:293:19)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Telegraf.launch (/home/alessandro/Scrivania/chatgpt-telegram-bot/node_modules/telegraf/lib/telegraf.js:182:78) {
response: { ok: false, error_code: 404, description: 'Not Found' },
on: { method: 'getMe', payload: {} }
}

Node.js v18.13.0

┌──(root㉿kali)-[/home/alessandro/Scrivania/chatgpt-telegram-bot]
└─#
`

I generated my own token thru botfather but and of course i pasted it in my .env file but it's not working. How does it work?
thanks

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.