forked from TeamInflex/InflexMusicBot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.py
139 lines (106 loc) · 8.99 KB
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
import re
import random
from os import getenv
from dotenv import load_dotenv
from pyrogram import filters
load_dotenv()
# Get this value from my.telegram.org/apps
API_ID = int(getenv("API_ID"))
API_HASH = getenv("API_HASH")
# Get your token from @BotFather on Telegram.
BOT_TOKEN = getenv("BOT_TOKEN")
# Get your mongo url from cloud.mongodb.com
MONGO_DB_URI = getenv("MONGO_DB_URI", None)
DURATION_LIMIT_MIN = int(getenv("DURATION_LIMIT", 60))
# Chat id of a group for logging bot's activities
LOG_GROUP_ID = int(getenv("LOG_GROUP_ID", None))
# Get this value from @MissRose_Bot on Telegram by /id
OWNER_ID = int(getenv("OWNER_ID", None))
# Fill Queue Limit . Example - 15
QUEUE_LIMIT = int(getenv("QUEUE_LIMIT", "10"))
## Fill these variables if you're deploying on heroku.
# Your heroku app name
HEROKU_APP_NAME = getenv("HEROKU_APP_NAME")
# Get it from http://dashboard.heroku.com/account
HEROKU_API_KEY = getenv("HEROKU_API_KEY")
UPSTREAM_REPO = getenv(
"UPSTREAM_REPO",
"https://github.com/tz-kid/tz-kid",
)
UPSTREAM_BRANCH = getenv("UPSTREAM_BRANCH", "master")
GIT_TOKEN = getenv(
"GIT_TOKEN", None
) # Fill this variable if your upstream repository is private
UPSTREAM_BRANCH = getenv("UPSTREAM_BRANCH", "main")
GIT_TOKEN = getenv(
"GIT_TOKEN", None
) # Fill this variable if your upstream repository is private
SUPPORT_CHANNEL = getenv("SUPPORT_CHANNEL", "https://t.me/art_loop")
SUPPORT_GROUP = getenv("SUPPORT_GROUP", "https://t.me/hey_aliens")
# Set this to True if you want the assistant to automatically leave chats after an interval
AUTO_LEAVING_ASSISTANT = bool(getenv("AUTO_LEAVING_ASSISTANT", False))
# Get this credentials from https://developer.spotify.com/dashboard
SPOTIFY_CLIENT_ID = getenv("SPOTIFY_CLIENT_ID", None)
SPOTIFY_CLIENT_SECRET = getenv("SPOTIFY_CLIENT_SECRET", None)
# Maximum limit for fetching playlist's track from youtube, spotify, apple links.
PLAYLIST_FETCH_LIMIT = int(getenv("PLAYLIST_FETCH_LIMIT", 25))
# Telegram audio and video file size limit (in bytes)
TG_AUDIO_FILESIZE_LIMIT = int(getenv("TG_AUDIO_FILESIZE_LIMIT", 104857600))
TG_VIDEO_FILESIZE_LIMIT = int(getenv("TG_VIDEO_FILESIZE_LIMIT", 1073741824))
# Checkout https://www.gbmb.org/mb-to-bytes for converting mb to bytes
# Get your pyrogram v2 session from Replit
STRING1 = getenv("STRING_SESSION", None)
STRING2 = getenv("STRING_SESSION2", None)
STRING3 = getenv("STRING_SESSION3", None)
STRING4 = getenv("STRING_SESSION4", None)
STRING5 = getenv("STRING_SESSION5", None)
BANNED_USERS = filters.user()
adminlist = {}
lyrical = {}
votemode = {}
autoclean = []
confirmer = {}
START_IMG_URL = ["https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg"]
PING_IMG_URL = ["https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg"]
STATS_IMG_URL = ["https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg"]
PLAYLIST_IMG_URL = getenv(
"PLAYLIST_IMG_URL", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg"
)
TELEGRAM_AUDIO_URL = getenv(
"TELEGRAM_AUDIO_URL", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg"
)
TELEGRAM_VIDEO_URL = getenv(
"TELEGRAM_VIDEO_URL", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg"
)
STREAM_IMG_URL = getenv(
"STREAM_IMG_URL", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg"
)
SOUNCLOUD_IMG_URL = getenv(
"SOUNCLOUD_IMG_URL", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg"
)
YOUTUBE_IMG_URL = getenv(
"YOUTUBE_IMG_URL", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg"
)
SPOTIFY_ARTIST_IMG_URL = getenv(
"SPOTIFY_ARTIST_IMG_URL", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg"
)
SPOTIFY_ALBUM_IMG_URL = getenv(
"SPOTIFY_ALBUM_IMG_URL", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg"
)
SPOTIFY_PLAYLIST_IMG_URL = getenv(
"SPOTIFY_PLAYLIST_IMG_URL", "https://telegra.ph/file/366929fa7ea5bcf420133.jpg"
)
def time_to_seconds(time):
stringt = str(time)
return sum(int(x) * 60**i for i, x in enumerate(reversed(stringt.split(":"))))
DURATION_LIMIT = int(time_to_seconds(f"{DURATION_LIMIT_MIN}:00"))
if SUPPORT_CHANNEL:
if not re.match("(?:http|https)://", SUPPORT_CHANNEL):
raise SystemExit(
"[ERROR] - Your SUPPORT_CHANNEL url is wrong. Please ensure that it starts with https://"
)
if SUPPORT_GROUP:
if not re.match("(?:http|https)://", SUPPORT_GROUP):
raise SystemExit(
"[ERROR] - Your SUPPORT_GROUP url is wrong. Please ensure that it starts with https://"
)