TheHamkerCat 2 tahun lalu
induk
melakukan
04de2da8e9
8 mengubah file dengan 19 tambahan dan 6 penghapusan
  1. 1 0
      .dockerignore
  2. 1 0
      .gitignore
  3. 4 2
      Dockerfile
  4. 8 0
      docker-compose.yml
  5. 1 1
      requirements.txt
  6. 1 1
      sample_config.py
  7. 1 0
      wbb/__init__.py
  8. 2 2
      wbb/modules/admin.py

+ 1 - 0
.dockerignore

@@ -15,3 +15,4 @@ __pycache__/
 config.py
 *.session
 *.session-journal
+venv

+ 1 - 0
.gitignore

@@ -157,3 +157,4 @@ error.log
 permissions.json
 .vscode
 .idea
+*.env

+ 4 - 2
Dockerfile

@@ -1,9 +1,11 @@
-FROM williambutcherbot/python:latest
+FROM python:slim-bullseye
 
 WORKDIR /wbb
 RUN chmod 777 /wbb
 
-# Installing Requirements
+RUN apt-get -qq update && apt-get -qq -y upgrade
+RUN DEBIAN_FRONTEND=noninteractive apt-get install -y git gcc build-essential
+
 RUN pip3 install -U pip
 COPY requirements.txt .
 RUN pip3 install --no-cache-dir -U -r requirements.txt

+ 8 - 0
docker-compose.yml

@@ -0,0 +1,8 @@
+services:
+  wbb:
+    build: .
+    restart: always
+    environment:
+      - PYTHONUNBUFFERED=1
+    volumes:
+      - ./sessions:/wbb/sessions

+ 1 - 1
requirements.txt

@@ -5,7 +5,7 @@ gTTS~=2.5.1
 dnspython==2.1.0
 future~=1.0.0
 googletrans~=4.0.0-rc1
-motor~=3.4.0
+motor~=3.6
 pillow~=10.3.0
 psutil~=5.9.8
 pykeyboard~=0.1.5

+ 1 - 1
sample_config.py

@@ -10,7 +10,7 @@ BOT_TOKEN = os.environ.get("BOT_TOKEN")
 API_ID = int(os.environ.get("API_ID"))
 SESSION_STRING = os.environ.get("SESSION_STRING", "")
 API_HASH = os.environ.get("API_HASH")
-USERBOT_PREFIX = os.environ.get("USERBOT_PREFIX", ".")
+USERBOT_PREFIX = os.environ.get("USERBOT_PREFIX", "\\")
 PHONE_NUMBER = os.environ.get("PHONE_NUMBER")
 SUDO_USERS_ID = list(map(int, os.environ.get("SUDO_USERS_ID", "").split()))
 LOG_GROUP_ID = int(os.environ.get("LOG_GROUP_ID"))

+ 1 - 0
wbb/__init__.py

@@ -41,6 +41,7 @@ if is_config:
 else:
     from sample_config import *
 
+
 USERBOT_PREFIX = USERBOT_PREFIX
 GBAN_LOG_GROUP_ID = GBAN_LOG_GROUP_ID
 WELCOME_DELAY_KICK_SEC = WELCOME_DELAY_KICK_SEC

+ 2 - 2
wbb/modules/admin.py

@@ -368,7 +368,7 @@ async def list_ban_(c, message: Message):
     )
     try:
         msgtext = (await app.get_messages(uname, mid)).text
-        gusernames = re.findall("@\w+", msgtext)
+        gusernames = re.findall(r"@\w+", msgtext)
     except:
         return await m.edit_text("Could not get group usernames")
     count = 0
@@ -417,7 +417,7 @@ async def list_unban_(c, message: Message):
     )
     try:
         msgtext = (await app.get_messages(uname, mid)).text
-        gusernames = re.findall("@\w+", msgtext)
+        gusernames = re.findall(r"@\w+", msgtext)
     except:
         return await m.edit_text("Could not get the group usernames")
     count = 0