Skip to content

🤖🗨 Telegram bot that connects kurdish speaking people to ChatGPT.

License

Notifications You must be signed in to change notification settings

ahme-dev/kurdgpt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KurdGPT 🤖🗨

A telegram bot that connects kurdish speaking people to ChatGPT.

preview

You can use at @KurdGPTBot 🔗 Due to the limitations of funding, the bot let's you send 3 messages per day. You're however free to host your own bot, using the code in this repo.

You can contribute to the project if you want.


Todo

  • Do not translate code sections.
  • Add buttons for some actions.
  • Add ability for admin to change daily messages left for users.

Copy

Clone the repo.

git clone https://github.com/ahmeddots/kurdgpt;

Install dependencies.

npm i;

Check the .env.example file and create a .env file with the same variables. You have to fill all the variables in the .env file.

The BOT_TOKEN variable:

  • Got to BotFather@ and create a bot.
  • Copy the token and paste it in the .env file.

The AI_KEY variable:

  • Go to the API Keys page
  • If you don't have an account, create one.
  • Create a new API key, copy it, and paste it in the .env file.

The TRANSL_KEY variable: (god help you with this one)

  • Go to the Google Cloud Translation API page
  • If you don't have an account, create one.
  • Create a new project.
  • Enable the Translation API.
  • Get a key for the API, copy it, and paste it in the .env file.

The ADMIN_ID variable:

  • Go to @userinfobot and get your ID.
  • Paste it in the .env file.

The DB_URL variable: (To get this you need to deploy the app)

  • Go to Fly.io and create an account.
  • Install the flyctl CLI.
npm i -g flyctl;
  • Login to flyctl.
flyctl auth login;
  • Change the name of the app in the fly.toml file.
  • Deploy the app.
flyctl deploy;
  • After the app is deployed, a URL of the DB will display. Copy it into the .env file.

🎉 Now your very own bot should be running.


Change Bot

You can also change the bot for your needs, and place your own limits.

You only need to change the variables in the src/constants.ts file.

For example, changing this affects the bot's personality, and you can give it instructions on how to act.

export const AI_INITIAL_PROMPT =
	"You are a helpful and very funny AI bot named KurdGPT, created by Ahmed, but you don't need to mention these facts.
  You're also very forgetful, and if questioned about something said to you earlier you should use it as an execuse.
  Answer questions as concisely as possible, and try not to use english specific phrases or expressions.
  Also inject a bit of humor from time to time in your replies.";

And this changes how many messages a user can send in a day.

export const USER_DAILY_MESSAGE_LIMIT = 3;

About

🤖🗨 Telegram bot that connects kurdish speaking people to ChatGPT.

Resources

License

Stars

Watchers

Forks