{"id":20000050,"url":"https://github.com/rishabhraj43/emotion-detector-telegram-bot","last_synced_at":"2026-04-05T22:36:24.298Z","repository":{"id":253129314,"uuid":"842557089","full_name":"RishabhRaj43/Emotion-Detector-Telegram-Bot","owner":"RishabhRaj43","description":"A Telegram Bot made with pure JavaScript and Machine Learning model made in Python","archived":false,"fork":false,"pushed_at":"2024-08-15T18:45:12.000Z","size":1675,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-01T23:41:26.039Z","etag":null,"topics":["flask","javascript","machine-learning-algorithms","node-js","python"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RishabhRaj43.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-14T15:36:48.000Z","updated_at":"2024-08-15T18:45:16.000Z","dependencies_parsed_at":"2025-01-12T12:51:49.669Z","dependency_job_id":"f2af9f19-fcc9-4bfc-82c5-df71d728388f","html_url":"https://github.com/RishabhRaj43/Emotion-Detector-Telegram-Bot","commit_stats":null,"previous_names":["rishabhraj43/emotion-detector-telegram-bot","zenith-rish4bh/emotion-detector-telegram-bot"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/RishabhRaj43/Emotion-Detector-Telegram-Bot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RishabhRaj43%2FEmotion-Detector-Telegram-Bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RishabhRaj43%2FEmotion-Detector-Telegram-Bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RishabhRaj43%2FEmotion-Detector-Telegram-Bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RishabhRaj43%2FEmotion-Detector-Telegram-Bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RishabhRaj43","download_url":"https://codeload.github.com/RishabhRaj43/Emotion-Detector-Telegram-Bot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RishabhRaj43%2FEmotion-Detector-Telegram-Bot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31452899,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T21:22:52.476Z","status":"ssl_error","status_checked_at":"2026-04-05T21:22:51.943Z","response_time":75,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flask","javascript","machine-learning-algorithms","node-js","python"],"created_at":"2024-11-13T05:13:39.127Z","updated_at":"2026-04-05T22:36:24.260Z","avatar_url":"https://github.com/RishabhRaj43.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Telegram Emotion Bot\n\nThis is a Telegram bot built using JavaScript that interacts with users and predicts emotions from the text they input. The bot can also cheer up the user by telling jokes if a negative emotion is detected.\n\n## Features\n\n- **Start and Help Commands**: Basic commands to start and get help on using the bot.\n- **Emotion Prediction**: Users can input text to check for emotions.\n- **Jokes**: If a negative emotion is detected, the bot offers to cheer up the user with a joke.\n- **Custom Keyboard**: Provides a custom keyboard for easy command selection.\n\n## Technologies Used\n\n- **Node.js**: Backend logic and bot interaction.\n- **Telegram Bot API**: To interface with Telegram.\n- **Express and Flask**: Flask is used for the emotion prediction API, and Express is used as a basic server (if needed).\n- **Axios**: To handle HTTP requests.\n- **Python**: For the emotion prediction model using scikit-learn.\n\n## Setup and Installation\n\n1. **Clone the Repository**:\n   \n    ```\n    git clone https://github.com/Zenith-Rish4bh/Emotion-Detector-Telegram-Bot.git\n    cd telegram-emotion-bot\n    ```\n\n3. **Install Node.js Dependencies**:\n   \n    ``` bash\n    npm install\n    ```\n\n5. **Set Up Environment Variables**:\n    - Create a `.env` file in the root directory.\n    - Add your Telegram bot token:\n      \n      ``` env\n      TOKEN = your-telegram-bot-token\n      ```\n\n6. **Install Python Dependencies**:\n   \n    ```bash\n    pip install flask flask-cors scikit-learn joblib\n    ```\n\n7. **Prepare the Emotion Model**:\n   \n    - Train an emotion detection model and save it as `emotion.pkl` in the root directory.\n\n8. **Run the Python Server**:\n   \n    - Navigate to the directory containing your Python script and run:\n      \n    ```bash\n    python app.py\n    ```\n\n10. **Run the Telegram Bot**:\n    - Start the bot by running:\n      \n    ```bash\n    npm start\n    ```\n\n## Usage\n\n- **Commands**:\n    - `/start`: Start the bot.\n    - `/help`: Get a list of available commands.\n    - `/checkemotion`: Enter text to analyze emotion.\n    - `/joke`: Get a random joke.\n    - `/command`: Display the custom keyboard.\n\n- **Interaction Flow**:\n    1. Start the bot with `/start`.\n    2. Use `/checkemotion` to input text and receive an emotion analysis.\n    3. If a negative emotion is detected, the bot offers to tell a joke to cheer you up.\n\n## API Endpoints\n\n- **POST /predict**:\n    - Accepts: JSON containing the text to be analyzed.\n    - Returns: JSON containing the predicted emotion.\n\n## Example Interaction\n\n1. **User**: `/start`\n    - **Bot**: \"Hello there! How can I help you?\"\n\n2. **User**: `/checkemotion`\n    - **Bot**: \"Enter the text you want to check.\"\n\n3. **User**: `\"I'm feeling down today.\"`\n    - **Bot**: \"The emotion is sadness. Do you want to cheer your mood by reading some jokes? Press /joke\"\n  \n------------------------------------------------------------------\n\n\u003ch1 style=\"color:blue;\"\u003eHappy Coding 🎉\u003c/h1\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frishabhraj43%2Femotion-detector-telegram-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frishabhraj43%2Femotion-detector-telegram-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frishabhraj43%2Femotion-detector-telegram-bot/lists"}