Skip to content

Commit

Permalink
fix: don't fail starting on Heroku due to .env not being filled
Browse files Browse the repository at this point in the history
also a small Readme update
  • Loading branch information
EDM115 committed May 7, 2024
1 parent 871666c commit c137354
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 30 deletions.
68 changes: 39 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,28 @@
<div align="center">

# Unarchiver Bot

## A Telegram bot to extract various types of archives

![Unzip logo](https://telegra.ph/file/d4ba24682e030fc58613f.jpg)
<img src="https://telegra.ph/file/d4ba24682e030fc58613f.jpg" alt="Unzip logo" width="200" height="200">

[![DeepSource](https://app.deepsource.com/gh/EDM115/unzip-bot.svg/?label=active+issues&show_trend=true&token=17SfwVx77dbrFlixtGdQsQNh)](https://app.deepsource.com/gh/EDM115/unzip-bot/?ref=repository-badge)

[![Unzip-Bot Analytics](https://repobeats.axiom.co/api/embed/5c857b55b42dd8235388093858b74341f6c679ac.svg)](https://github.com/EDM115/unzip-bot/pulse)

</div>

</br></br>

## Working bot 🥰

[@unzip_edm115bot](https://t.me/unzip_edm115bot)
[@unzip_edm115bot](https://t.me/unzip_edm115bot)

## Features 👀

- Extract all format of archives like `rar`, `zip`, `tar`, `7z`, `tar.xz`, …
- Supports password protected archives
- Extract archives from direct links
- Broadcast messages to users
- Ban / Unban users from using your bot
- Ban/Unban users from using your bot
- Send logs in a private channel/group
- Can run only one extract per user at a time
- Fast to answer and process tasks
Expand All @@ -35,31 +33,31 @@
- Can rename files
- Able to process splitted archives (`.001`)
- And some other features 🔥 Dive into the code to find them 🤭


## Config vars 📖

- `APP_ID` - Your APP ID. Get it from [my.telegram.org](my.telegram.org)
- `API_HASH` - Your API_HASH. Get it from [my.telegram.org](my.telegram.org)
- `BOT_OWNER` - Your Telegram Account ID. Get it from [@MissRose_bot](https://t.me/MissRose_bot) (Start the bot and send <samp>/info</samp> command).
- `BOT_OWNER` - Your Telegram Account ID. Get it from [@MissRose_bot](https://t.me/MissRose_bot) (Start the bot and send `/info` command).
- `BOT_TOKEN` - Bot Token of Your Telegram Bot. Get it from [@BotFather](https://t.me/BotFather)
- `MONGODB_URL` - Your MongoDB URL ([**tutorial here**](./CreateMongoDB.md))
- `LOGS_CHANNEL` - Make a private channel and get its ID (search on Google if you don't know how to do). Using a group works as well, just add [`Rose`](https://t.me/MissRose_bot?startgroup=startbot), then send `/id` (In both cases, **make sure to add your bot to the channel/group as an admin !**)

## Commands ✍️

Copy-paste those to BotFather when he asks you for them
Copy-paste those to BotFather when he asks you for them

```
commands - Get commands list
mode - Upload as Doc 📄 / Media 📺
addthumb - Add custom thumbnail
delthumb - Remove your thumbnail
addthumb - Add custom thumbnail
delthumb - Remove your thumbnail
stats - Know if bot is overused
clean - Cancel on-going process
help - In case you need 😭
```
```

## Deploy 🚧

Deploying is easy 🥰 You can deploy this bot in Heroku or in a VPS ♥️
Expand All @@ -68,25 +66,28 @@ Deploying is easy 🥰 You can deploy this bot in Heroku or in a VPS ♥️
> ⚠️ Note :
> We are using arch linux. But why 🤔
>
> Because archs p7zip package is the only maintained version of the [original p7zip](http://p7zip.sourceforge.net/) package with some additional features
> Because arch's p7zip package is the only maintained version of the [original p7zip](http://p7zip.sourceforge.net/) package with some additional features
---

#### The lazy way
#### The lazy way

[![Deploy me 🥺](https://www.herokucdn.com/deploy/button.svg)](https://www.heroku.com/deploy?template=https://github.com/EDM115/unzip-bot)
(if you're in a fork, make sure to replace the template URL with your repos one)
(if you're in a fork, make sure to replace the template URL with your repo's one)

---

#### The easy way

+ Install [Docker](https://www.docker.com/) then restart your computer

```bash
git clone -b master https://github.com/EDM115/unzip-bot.git
git clone https://github.com/EDM115/unzip-bot.git
cd unzip-bot
nano .env
docker build -t unzip-bot .
```

+ Open Docker Desktop, go on the Images tab, click on the Run button
+ On Optional settings, fill the env variables

Expand All @@ -95,23 +96,24 @@ docker build -t unzip-bot .
#### The legacy way

```bash
git clone -b master https://github.com/EDM115/unzip-bot.git
git clone https://github.com/EDM115/unzip-bot.git
cd unzip-bot
pip3 install -r requirements.txt
```
+ Arch linux only ↓
`sudo pacman -S p7zip`

##### Edit config.py with your own values
+ Install required dependencies
Arch Linux : `sudo pacman -S p7zip`
Ubuntu/Debian : `sudo apt-get install p7zip-full p7zip-rar`
+ Edit `.env` with your own values

```bash
start.sh
chmod +x start.sh && ./start.sh
```

---

**DONE 🥳 enjoy the bot !** Be sure to follow me on [Github](https://github.com/EDM115) and Star 🌟 this repo to show some support 🥺

## How to Build after changes ?

#### Trust GitHub Actions
Expand All @@ -126,35 +128,43 @@ start.sh
#### Do it manually

+ Go in the repo's folder

```bash
docker build -t unzip-bot .
```

+ If you wanna publish :

```bash
docker tag unzip-bot edm115/unzip-bot:latest
```

*(replace `edm115` with your docker hub username, `unzip-bot` with the repo's name and `latest` whith whatever you want)*

```bash
docker login
```

*login and don't mind the errors*

```bash
docker push edm115/unzip-bot:latest
```

*(same, replace accordingly)*

## Found a bug 🐞

If you found a bug in this bot please open an [issue](https://github.com/EDM115/unzip-bot/issues) or report it on Telegram : [@EDM115](https://t.me/EDM115)
Same if you have any feature request 😉

## License & Copyright 👮‍♀️

```
Copyright (c) 2022 - 2023 EDM115
Copyright (c) 2022 EDM115
This Unarchiver Bot repository is licensed under MIT License (https://github.com/EDM115/unzip-bot/blob/master/LICENSE)
Enjoy copying and modifying, but always mention me
```

• Inspired by Itz-fork/Nexas work, but with additional features and bug fixes. This is a maintained repo of the [original](https://github.com/Itz-fork/Unzipper-Bot)
• Inspired by Itz-fork/Nexa's work, but with additional features and bug fixes. This is a maintained repo of the [original](https://github.com/Itz-fork/Unzipper-Bot)
6 changes: 5 additions & 1 deletion start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,9 @@ Copyright (c) 2022 - 2024 EDM115
--> Join @EDM115bots on Telegram
--> Follow EDM115 on Github
"
source .env
if grep -qE '^[^#]*=\s*("|'\''?)\s*\1\s*$' .env; then
echo "Some required vars are empty, please fill them unless you're filling them somewhere else (ex : Heroku, Docker Desktop)"
else
source .env
fi
python3 -m unzipper

0 comments on commit c137354

Please sign in to comment.