Skip to content

Commit

Permalink
Integrated Telegram Bot Structure to include API and user interface fโ€ฆ
Browse files Browse the repository at this point in the history
โ€ฆrom Telegrambot 1.1 (#3)

## ๐ŸŽ‰ Pull Request Title

Integrated Telegram Bot Structure to include API and user interface from
Telegrambot 1.1

## โœจ Description

Added new features between the Jikan API and Python-Telegram-Bot. Fixed
an issue with Googletrans, which is used for translation to Spanish,
English, French, Italian, Russian, Hindi, etc. This bot can send the
following information about anime:
* Title (translated)
*  Japanese title
* Type (TV, OVA, etc.)
* Genre (refer to the readme.md)
* Episodes
* Score
* Rating
* Status
* Synopsis 
---------
For Hentai or Erotica requests, the picture is sent in spoiler format. 
Additionally, thereโ€™s a JSON file for uploading IDs by gender (please
donโ€™t run this script, as it takes about 8 hours to finish and will
overwrite the main JSON file).

### Working on ๐Ÿงฐ โš’๏ธ 

Weโ€™re also working on comparing the local database with the Jikan
database to provide links to anime websites.

## ๐Ÿ”— Related Issue

None

## โœ… Checklist

- [x] **I have tested these changes locally.** ๐Ÿงช
- [x] **I have updated the documentation (if necessary).** ๐Ÿ“š
-  [x] **~I have added relevant tests (if applicable).~** ๐Ÿงฉ
- [x] **I have assigned reviewers.** ๐Ÿ‘ฅ @AlejoCM03 
- [x ] **I have resolved any merge conflicts.** ๐Ÿ”„

## ๐Ÿ“ธ Screenshots 
Description | Screenshot | Description | Screenshot |

:-------------------------:|:-------------------------:|:-------------------------:|:-------------------------:
Start screen of the Bot | <img
src="https://github.com/user-attachments/assets/20533ecb-fea9-459a-985d-a06fec613c5b"
width="200" />|/start command | <img
src="https://github.com/user-attachments/assets/ae26ee26-302c-400a-baf8-fccd5ad7faf5"
width="200"/>
Menu of the Bot | <img
src="https://github.com/user-attachments/assets/468be224-94aa-4259-8700-ddfb783ebf3e"
width="200" />|/language command | <img
src="https://github.com/user-attachments/assets/41a4e435-26b9-4eb1-87fd-7de212afbe34"
width="200"/>
/request + [anime name] command| <img
src="https://github.com/user-attachments/assets/36a66250-0411-4e6a-9ddc-b6ee9fca7185"
width="200" />|/random command | <img
src="https://github.com/user-attachments/assets/08b5058e-86e7-496e-bbda-9ef4b6d4112c"
width="200"/>
/hoshii + [gender] command| <img
src="https://github.com/user-attachments/assets/22765567-2b86-41f8-9c21-c597d0bbfa0e"
width="200" />|/hoshii "(hentai/Erotica)" command (The bot doesn't show
the picture) | <img
src="https://github.com/user-attachments/assets/123c5a24-c980-41fe-9ba6-b8b369c454f2"
width="200"/>
/help command| <img
src="https://github.com/user-attachments/assets/b1a77682-05bd-4882-b6b3-5e6234750dd9"
width="200" />| |
  • Loading branch information
JohnKun136NVCP authored Jul 25, 2024
2 parents b4a824c + 25ecf37 commit 4156b36
Show file tree
Hide file tree
Showing 13 changed files with 32,022 additions and 0 deletions.
165 changes: 165 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
.pdm.toml
.pdm-python
.pdm-build/

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

#This directory
hoshibot-env/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
42 changes: 42 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# ๐ŸŒธ Contributing to hoshiiTelegramBot ๐ŸŒธ

First off, thanks for taking the time to contribute! ๐ŸŽ‰ Your help is much appreciated! ๐Ÿ’–

The following is a set of guidelines for contributing to **hoshiiTelegramBot**. These are mostly guidelines, not strict rules. Use your best judgment, and feel free to propose changes to this document in a pull request. ๐ŸŒŸ

## ๐ŸŒŸ How Can I Contribute?

### ๐Ÿž Reporting Bugs

Help us improve by reporting bugs effectively! ๐Ÿ›
- **Ensure the bug was not already reported** by searching on GitHub under Issues. ๐Ÿ”
- If you're unable to find an open issue addressing the problem, open a new one. Be sure to include a **title and clear description**, as much relevant information as possible, and a **code sample** or an **executable test case** demonstrating the expected behavior that is not occurring. โœจ

### ๐ŸŒˆ Suggesting Enhancements

Got an idea to make things better? Let us know! ๐Ÿ’ก
- **Ensure the enhancement was not already suggested** by searching on GitHub under Issues. ๐Ÿ”
- If you're unable to find an open issue addressing the enhancement, open a new one. Be sure to include a **title and clear description**, as much relevant information as possible, and a **code sample** or an **executable test case** demonstrating the expected behavior. โœจ

### ๐ŸŒธ Pull Requests

Ready to make some changes? Follow these steps! ๐ŸŒผ
- **Fork** the repository. ๐Ÿด
- **Clone** your fork: `git clone https://github.com/your-username/[your-repo].git` ๐Ÿ“‚
- **Create a branch**: `git checkout -b my-branch` ๐ŸŒฟ
- **Make your changes**. ๐Ÿ› ๏ธ
- **Commit your changes**: `git commit -m 'Add some feature'` ๐Ÿ’ฌ
- **Push to the branch**: `git push origin my-branch` ๐Ÿš€
- **Submit a pull request**: open a pull request. ๐Ÿ’–

## ๐Ÿ’– Code of Conduct

This project and everyone participating in it is governed by the Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to [email protected]. ๐Ÿšซ

## ๐Ÿ“œ License

By contributing, you agree that your contributions will be licensed under the AGPL-3.0 License. ๐Ÿ“

---

Thank you for being awesome! ๐ŸŒŸ Your contributions make this project better! ๐ŸŽ€
105 changes: 105 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
<p align="center">
<img src="img/logo_draf.png" alt="Kawaii Bot" width="200px"/>
</p>

<h1 align="center">๐ŸŒธ hoshiiTelegramBot ๐ŸŒธ</h1>

<p align="center">
<img src="https://img.shields.io/badge/version-1.1..0-brightgreen" alt="Version" />
<img src="https://img.shields.io/badge/license-AGPL3.0-blue?style=flat&color=blue" alt="License" />
<img src="https://img.shields.io/badge/test-passed-pass?style=flat&color=red" alt="Build" />
</p>

Welcome to the **hoshiiTelegramBot**! This adorable Telegram bot fetches anime and manga details from various APIs, including Jikan API and Google. It supports multiple languages and provides personalized! ๐ŸŒŸ

## ๐ŸŒŸ Features

- Fetches detailed information about anime and manga from Jikan API and Google.
- Supports multiple languages for a global audience.
- Provides personalized recommendations based on your preferences.
- Cute and user-friendly interface for the best experience.

## ๐Ÿ› ๏ธ Installation

> [!TIP]
> Use a virtual environment. Don't know how to create one? Let me show you how to create it. ๐Ÿ‘‰ Click here **[documentation](https://docs.python.org/3/library/venv.html)**.
> [!NOTE]
> Previously, you should have created your Telegram Bot. Please, If you don't do it yet, check the official **[documentation](https://core.telegram.org/bots#how-do-i-create-a-bot)** ๐Ÿค–.
1. Clone the repository:
```bash
git clone https://github.com/Hoshimya-Animation/hoshiTelegramBot
cd hoshiTelegramBot
```

2. Install the required dependencies:
```bash
pip3 install -r requirements.txt
```
3. Open the file **main.py** and replace your Telegram Token of your Bot on ```TELEGRM_TOKEN```, i.e. ```"123+2"``` .

4. Run the bot: ๐Ÿค–
```bash
python main.py
```

## ๐ŸŒ Usage

Add the bot to your Telegram and start chatting with it! Use the following commands to get started:

- `/start` - The bot starts โ‚^ >ใƒฎ<^โ‚Ž .แŸ. kawaii journey!
- `/language`- Change language of the Bot ๐Ÿ‡ช๐Ÿ‡ธ โžก๏ธ ๐Ÿ‡ฌ๐Ÿ‡ง (Available in Spanish, English, French, Italian, Traditional Chinese, Japanese, Hindi, German, Arabic, Romanian, and Korean)
- `/request [name]` - Request a new anime from our database (still in progress) or if it's available on MyAnimeList list ๐Ÿ—„ (Japanese or English).
- `/random` - Random information about an anime ๐ŸŽฒ
- `/hoshii [gender]` - Anime suggestion by the gender ๐ŸŒ๐Ÿฑ (Action, Comedy, Horror, Sports, Adventure, Drama, Mystery, Supernatural, Avant Garde, Fantasy, Romance,Suspense, Award Winning, Girls Love, Sci-Fi, Boys Love,Gourmet, Slice of Life, Ecchi, Erotica, Hentai).
- `/help` - Give you information about my functions ๐Ÿ†˜โ”.
## ๐Ÿ”ง Configuration
> [!NOTE]
> If you run ```main.py``` the interpreter shows you this message ```AttributeError: module 'httpcore' has no attribute 'SyncHTTPTransport```
> [!IMPORTANT]
> Googletrans has an important issue nowadays. HTTPX package version for Googletrans is 0.13.0, on other hand, Python-Telegram-Bot requires the version 0.27.0. Therefore there is a problem. However, you can fix temporaly this issue.
- In a new terminal use this command
```bash
pip list -v
```
> [!NOTE]
> This command shows you all packages installed with pip.
- Then, search for the package *googletrans*๐Ÿ”ค, go to the path where it's installed, and **ONLY MODIFY** โš ๏ธ the file ***client.py***. In this file, on line 62, you can comment it out and below it, type this:
```python
proxies: typing.Dict[str, httpcore.AsyncHTTPProxy] = None,
```
- Finally, save the document. ๐Ÿ“„
## ๐Ÿ“œ License
This project is licensed under the AGPL-3.0 License. See the [LICENSE](LICENSE) file for more details.
## ๐Ÿ™Œ Contributing
We welcome contributions from the community! Please read the [CONTRIBUTING](CONTRIBUTING.md) file for guidelines on how to contribute to this project.
## ๐Ÿ’– Acknowledgements
A big thank you to the developers of the Jikan API and Google for providing the data that makes this bot possible.
## ๐Ÿ“ฌ Contact
If you have any questions or suggestions, feel free to open an issue or reach out to us at [[email protected]](mailto:[email protected].).
<p align="center">
<img src="img/logo_draf2.png" alt="Kawaii Bot2""/>
</p>
<p align="center">
Made with ๐Ÿ’– by <a href="https://github.com/Hoshimya-Animation">Hoshimya Animation</a>, <a href="https://github.com/JohnKun136NVCP">John </a>
</p>
Loading

0 comments on commit 4156b36

Please sign in to comment.