Giter VIP home page Giter VIP logo

engeybot's Introduction

ENGEYBOT

NOW MOVED TO: https://github.com/fauzaanu/engeybot-cloudflare/

Engey (އެނގޭ) means knowing in Dhivehi. Bot is live on telegram under the handle of @engeybot

The bot uses openAI completion API to generate responses to user input.

The users are expected to send their queries in the syntax: why is the sky blue #idk

As long as #idk is present in the message the bot will try to generate a response.

Why? Because we can then use it in group chats without the bot distrupting the conversation if it is not meant for the bot.

ADDITIONAL LIBRARIES

we are using edge-tts by rany2 for text to speech. It provides the natural sounding voices on Microsoft Edge and is open source. You can find it from https://github.com/rany2/edge-tts

Credentials and UsersDB

The bot would need an additional file called cred.py to run. This is where all our api keys will be stored.

The file should look like this:

# cred.py
# This file is not included in the repo
OPEN_AI_KEY=""
TELEGRAM_API_KEY=""
ADMIN_ID=""

Admin_ID is a chat where logs are sent. I do not recommend using your own chat id as it will be spammed with logs. So make a private channel for the logs.

The bot also needs a usersdb.txt file to store all the chat ids of the users it interacts with. This data is collected just incase we need to send a broadcast message to all the users. Create a blank txt file called usersdb and the bot will automatically add the chat ids of the users it interacts with. It will automatically handle the duplicates.

INSTALLATION

As it is always recommended to make a virtual environment for python projects, we will be using virtualenv for this project. You can install it using pip3 install virtualenv python3 -m virtualenv venv

Next using virtualenv we can create an environment. For example we will be creating an environment called venv

Next we need to activate the environment. This can be done using source venv/bin/activate if you are on linux or venv\Scripts\activate if you are on windows

The installation is straight forward. You can install the requirements using pip3 install -r req.txt

Running the bot

No additional settings are required. You can run the bot using python3 bot.py

We use polling as of now and attempts to make it based on webhooks are in progress but not working as of now.

Contributing

Feel free to contribute to the project / fork the project and make it better. If you have any questions feel free to contact me on telegram or twitter @fauzaanu

engeybot's People

Contributors

fauzaanu avatar

Watchers

 avatar  avatar  avatar

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.