You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 4, 2023. It is now read-only.
@@ -129,6 +136,8 @@ Fill up rest of the fields. Meaning of each fields are discussed below:
129
136
-**DOWNLOAD_DIR**: The path to the local folder where the downloads should be downloaded to
130
137
-**DOWNLOAD_STATUS_UPDATE_INTERVAL**: A short interval of time in seconds after which the Mirror progress message is updated. (I recommend to keep it `5` seconds at least)
131
138
-**AUTO_DELETE_MESSAGE_DURATION**: Interval of time (in seconds), after which the bot deletes it's message (and command message) which is expected to be viewed instantly. (**Note**: Set to `-1` to never automatically delete messages)
139
+
-**UPSTREAM_REPO**: Link for Bot Upstream Repo, if you want default update, fill ```https://github.com/breakdowns/slam-mirrorbot```.
140
+
-**UPSTREAM_BRANCH**: Link for Bot Upstream Repo (Recommended using master branch)
132
141
### Optional Field
133
142
-**AUTHORIZED_CHATS**: Fill user_id and chat_id of you want to authorize.
134
143
-**IS_TEAM_DRIVE**: Set to `True` if `GDRIVE_FOLDER_ID` is from a Team Drive else `False` or Leave it empty.
Copy file name to clipboardExpand all lines: bot/helper/__init__.py
+70Lines changed: 70 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,78 @@
1
1
importasyncio
2
2
importos
3
3
importshlex
4
+
importheroku3
5
+
6
+
fromfunctoolsimportwraps
7
+
frompyrogram.typesimportMessage
4
8
fromtypingimportTuple
5
9
fromhtml_telegraph_posterimportTelegraphPoster
10
+
frombotimportHEROKU_API_KEY, HEROKU_APP_NAME
11
+
12
+
# Implement by https://github.com/jusidama18
13
+
# Setting Message
14
+
15
+
defget_text(message: Message) -> [None, str]:
16
+
"""Extract Text From Commands"""
17
+
text_to_return=message.text
18
+
ifmessage.textisNone:
19
+
returnNone
20
+
if" "intext_to_return:
21
+
try:
22
+
returnmessage.text.split(None, 1)[1]
23
+
exceptIndexError:
24
+
returnNone
25
+
else:
26
+
returnNone
27
+
28
+
# Preparing For Setting Config
29
+
# Implement by https://github.com/jusidama18 and Based on this https://github.com/DevsExpo/FridayUserbot/blob/master/plugins/heroku_helpers.py
30
+
31
+
heroku_client=None
32
+
ifHEROKU_API_KEY:
33
+
heroku_client=heroku3.from_key(HEROKU_API_KEY)
34
+
35
+
defcheck_heroku(func):
36
+
@wraps(func)
37
+
asyncdefheroku_cli(client, message):
38
+
heroku_app=None
39
+
ifnotheroku_client:
40
+
awaitmessage.reply_text("`Please Add HEROKU_API_KEY Key For This To Function To Work!`", parse_mode="markdown")
41
+
elifnotHEROKU_APP_NAME:
42
+
awaitmessage.reply_text("`Please Add HEROKU_APP_NAME For This To Function To Work!`", parse_mode="markdown")
43
+
ifHEROKU_APP_NAMEandheroku_client:
44
+
try:
45
+
heroku_app=heroku_client.app(HEROKU_APP_NAME)
46
+
except:
47
+
awaitmessage.reply_text(message, "`Heroku Api Key And App Name Doesn't Match!`", parse_mode="markdown")
48
+
ifheroku_app:
49
+
awaitfunc(client, message, heroku_app)
50
+
51
+
returnheroku_cli
52
+
53
+
# Preparing For Update Bot
54
+
# Implement by https://github.com/jusidama18 and Based on this https://github.com/DevsExpo/FridayUserbot/blob/master/plugins/updater.py
0 commit comments