Skip to content

Commit 03c15a0

Browse files
authored
fixing import error
1 parent 51f03b9 commit 03c15a0

5 files changed

Lines changed: 28 additions & 7 deletions

File tree

.github/clone.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,13 @@ FILE=/app/.git
2929
if [ -d "$FILE" ] ; then
3030
echo "$FILE directory exists already."
3131
else
32-
git clone https://github.com/sandy1709/catuserbot cat_ub
3332
rm -rf userbot
34-
mv cat_ub/.git .
33+
rm -rf .github
34+
rm -rf requirements.txt
35+
git clone https://github.com/sandy1709/catuserbot cat_ub
3536
mv cat_ub/userbot .
37+
mv cat_ub/.github .
38+
mv cat_ub/.git .
3639
mv cat_ub/requirements.txt .
3740
rm -rf cat_ub
3841
python ./.github/update.py

.github/update.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
11
import asyncio
2+
import os
3+
import shlex
4+
from typing import Optional, Tuple
25

3-
from userbot import runcmd
6+
7+
async def runcmd(cmd: str) -> Tuple[str, str, int, int]:
8+
args = shlex.split(cmd)
9+
process = await asyncio.create_subprocess_exec(
10+
*args, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE
11+
)
12+
stdout, stderr = await process.communicate()
13+
return (
14+
stdout.decode("utf-8", "replace").strip(),
15+
stderr.decode("utf-8", "replace").strip(),
16+
process.returncode,
17+
process.pid,
18+
)
419

520

621
async def update_requirements():

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,4 @@ validators
6767
vcsi
6868
wand
6969
wikipedia
70-
youtube_dl==2020.11.1.1
70+
youtube_dl==2020.11.1.1

userbot/helpers/memeifyhelpers.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@
77
from typing import Optional, Tuple
88

99
import numpy as np
10-
from colour import Color as asciiColor
10+
11+
try:
12+
from colour import Color as asciiColor
13+
except:
14+
os.system("pip install colour")
1115
from PIL import Image, ImageDraw, ImageFont
1216
from telethon.errors.rpcerrorlist import YouBlockedUserError
1317
from wand.color import Color

userbot/plugins/updater.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@
1313
from git import Repo
1414
from git.exc import GitCommandError, InvalidGitRepositoryError, NoSuchPathError
1515

16-
from .. import CMD_HELP
1716
from ..utils import admin_cmd, edit_or_reply, sudo_cmd
18-
from . import runcmd
17+
from . import CMD_HELP, runcmd
1918

2019
HEROKU_APP_NAME = Var.HEROKU_APP_NAME
2120
HEROKU_API_KEY = Var.HEROKU_API_KEY

0 commit comments

Comments
 (0)