Explorar o código

hoe (#71)

Co-authored-by: Tejas61900 <tejas@tdrive.npwdkktu1zrudfipc3nbfnel2e.ix.internal.cloudapp.net>
Tejas61900 %!s(int64=5) %!d(string=hai) anos
pai
achega
050bcefc26
Modificáronse 9 ficheiros con 69 adicións e 23 borrados
  1. 0 7
      Aptfile
  2. 9 5
      Dockerfile
  3. 18 0
      README.md
  4. 1 9
      app.json
  5. 3 0
      heroku.yml
  6. 1 0
      requirements.txt
  7. 0 1
      runtime.txt
  8. 33 0
      sample_config.env
  9. 4 1
      sample_config.py

+ 0 - 7
Aptfile

@@ -1,7 +0,0 @@
-bash
-ffmpeg
-sudo
-neofetch
-wget
-curl
-git

+ 9 - 5
Dockerfile

@@ -1,15 +1,19 @@
-FROM ubuntu:latest
+FROM python:3.9.5-buster
 
-WORKDIR /usr/src/app
-RUN chmod 777 /usr/src/app
-RUN apt-get -qq update
-RUN DEBIAN_FRONTEND="noninteractive" apt-get -qq install python3 python3-pip software-properties-common
+WORKDIR /wbb
+RUN chmod 777 /wbb
+RUN apt-get update -y
+RUN apt-get install -y wget curl bash git neofetch sudo software-properties-common ffmpeg
 
 #Updating Libraries
 RUN pip3 install -U pip
 COPY requirements.txt .
 RUN pip3 install --no-cache-dir -U -r requirements.txt
 
+# If u want to use /update feature, uncomment the following and edit
+#RUN git config --global user.email "your_email"
+#RUN git config --global user.name "git_username"
+
 #Copying All Source
 COPY . .
 

+ 18 - 0
README.md

@@ -64,6 +64,24 @@ $ python3 str_gen.py
 [![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/thehamkercat/WilliamButcherBot/)
 
 
+## Docker
+
+```sh
+$ git clone https://github.com/TheHamkerCat/WilliamButcherBot && cd WilliamButcherBot
+
+$ cp sample_config.env config.env
+```
+Edit **config.env** with your own values
+
+# Build & Run
+
+```sh
+$ sudo docker build . -t wbb
+
+$ sudo docker run wbb
+```
+To stop use `CTRL+C`
+
 ## Note
 
 1. Support Chat: https://t.me/wbbsupport

+ 1 - 9
app.json

@@ -11,15 +11,7 @@
     "telegram-bot",
     "pyrogram"
     ],
-    "stack": "heroku-20",
-    "buildpacks": [
-      {
-        "url": "heroku/python"
-      },
-      {
-        "url": "heroku-community/apt"
-      }
-    ],
+    "stack": "container",
     "env": {
         "BOT_TOKEN": {
             "description": "Obtain a Telegram bot token by contacting @BotFather",

+ 3 - 0
heroku.yml

@@ -0,0 +1,3 @@
+build:
+  docker:
+      worker: Dockerfile

+ 1 - 0
requirements.txt

@@ -21,3 +21,4 @@ uvloop
 youtube_dl
 bs4
 wget
+python-dotenv

+ 0 - 1
runtime.txt

@@ -1 +0,0 @@
-python-3.9.4

+ 33 - 0
sample_config.env

@@ -0,0 +1,33 @@
+# Only for Docker Deployment
+
+BOT_TOKEN=your_bot_token # Get it from @botfather
+
+API_ID=your_api_id
+
+API_HASH=your_api_hash
+
+SESSION_STRING=your_session # Check Readme to generate sessions
+
+USERBOT_PREFIX=userbot_prefix
+
+SUDO_USERS_ID=682966383 # Sudo users have full access to everythin, don't trust anyone
+
+LOG_GROUP_ID=-125639839
+
+GBAN_LOG_GROUP_ID=-173738999
+
+MESSAGE_DUMP_CHAT=-173738999
+
+FERNET_ENCRYPTION_KEY=iKMq0WZMnJKjMQxZWKtv-cplMuF_LoyshXj0XbTGGWM= # Leave it
+
+WELCOME_DELAY_KICK_SEC=300 # Edit if u want
+
+MONGO_DB_URI=your_mongodb_uri
+
+ARQ_API_URL=http://thearq.tech # Leave it
+
+ARQ_API_KEY=your_api_key # Get it from @ARQRobot
+
+LOG_MENTIONS=True # Make It False If You Don't Want It
+
+SPAM_CHECK_EXCEPTION_GROUPS=-16628896 # Group where spam protection will be ignored , Seperated by space

+ 4 - 1
sample_config.py

@@ -1,4 +1,7 @@
-HEROKU = True  # NOTE Make it false if you're not deploying on heroku.
+from dotenv import load_dotenv
+load_dotenv('config.env')
+
+HEROKU = True  # NOTE Make it false if you're not deploying on heroku or docker.
 
 if HEROKU:
     from os import environ