forked from TeamYukki/YukkiMusicBot
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsample.env
355 lines (274 loc) · 10.8 KB
/
sample.env
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
#
# Copyright (C) 2021-2022 by TeamYukki@Github, < https://github.com/TeamYukki >.
#
# This file is part of < https://github.com/TeamYukki/YukkiMusicBot > project,
# and is released under the "GNU v3.0 License Agreement".
# Please see < https://github.com/TeamYukki/YukkiMusicBot/blob/master/LICENSE >
#
# All rights reserved.
import re
import sys
from os import getenv
from dotenv import load_dotenv
from pyrogram import filters
load_dotenv()
# Get it from my.telegram.org
API_ID = int(getenv("API_ID", ""))
API_HASH = getenv("API_HASH")
## Get it from @Botfather in Telegram.
BOT_TOKEN = getenv("BOT_TOKEN")
# Database to save your chats and stats... Get MongoDB:- https://telegra.ph/How-To-get-Mongodb-URI-04-06
MONGO_DB_URI = getenv("MONGO_DB_URI", None)
# Custom max audio(music) duration for voice chat. set DURATION_LIMIT in variables with your own time(mins), Default to 60 mins.
DURATION_LIMIT_MIN = int(
getenv("DURATION_LIMIT", "60")
) # Remember to give value in Minutes
# Duration Limit for downloading Songs in MP3 or MP4 format from bot
SONG_DOWNLOAD_DURATION = int(
getenv("SONG_DOWNLOAD_DURATION_LIMIT", "180")
) # Remember to give value in Minutes
# You'll need a Private Group ID for this.
LOG_GROUP_ID = int(getenv("LOG_GROUP_ID", ""))
# A name for your Music bot.
MUSIC_BOT_NAME = getenv("MUSIC_BOT_NAME")
# Your User ID.
OWNER_ID = list(
map(int, getenv("OWNER_ID", "").split())
) # Input type must be interger
# Get it from http://dashboard.heroku.com/account
HEROKU_API_KEY = getenv("HEROKU_API_KEY")
# You have to Enter the app name which you gave to identify your Music Bot in Heroku.
HEROKU_APP_NAME = getenv("HEROKU_APP_NAME")
# For customized or modified Repository
UPSTREAM_REPO = getenv(
"UPSTREAM_REPO",
"https://github.com/TeamYukki/YukkiMusicBot",
)
UPSTREAM_BRANCH = getenv("UPSTREAM_BRANCH", "master")
# GIT TOKEN ( if your edited repo is private)
GIT_TOKEN = getenv("GIT_TOKEN", None)
# Only Links formats are accepted for this Var value.
SUPPORT_CHANNEL = getenv(
"SUPPORT_CHANNEL", None
) # Example:- https://t.me/TheYukki
SUPPORT_GROUP = getenv(
"SUPPORT_GROUP", None
) # Example:- https://t.me/YukkiSupport
# Set it in True if you want to leave your assistant after a certain amount of time. [Set time via AUTO_LEAVE_ASSISTANT_TIME]
AUTO_LEAVING_ASSISTANT = getenv("AUTO_LEAVING_ASSISTANT", None)
# Time after which you're assistant account will leave chats automatically.
AUTO_LEAVE_ASSISTANT_TIME = int(
getenv("ASSISTANT_LEAVE_TIME", "5400")
) # Remember to give value in Seconds
# Time after which bot will suggest random chats about bot commands.
AUTO_SUGGESTION_TIME = int(
getenv("AUTO_SUGGESTION_TIME", "5400")
) # Remember to give value in Seconds
# Set it True if you want to delete downloads after the music playout ends from your downloads folder
AUTO_DOWNLOADS_CLEAR = getenv("AUTO_DOWNLOADS_CLEAR", None)
# Set it True if you want to bot to suggest about bot commands to random chats of your bots.
AUTO_SUGGESTION_MODE = getenv("AUTO_SUGGESTION_MODE", None)
# Set it true if you want your bot to be private only [You'll need to allow CHAT_ID via /authorise command then only your bot will play music in that chat.]
PRIVATE_BOT_MODE = getenv("PRIVATE_BOT_MODE", None)
# Time sleep duration For Youtube Downloader
YOUTUBE_DOWNLOAD_EDIT_SLEEP = int(getenv("YOUTUBE_EDIT_SLEEP", "3"))
# Time sleep duration For Telegram Downloader
TELEGRAM_DOWNLOAD_EDIT_SLEEP = int(getenv("TELEGRAM_EDIT_SLEEP", "5"))
# Your Github Repo.. Will be shown on /start Command
GITHUB_REPO = getenv("GITHUB_REPO", None)
# Spotify Client.. Get it from https://developer.spotify.com/dashboard
SPOTIFY_CLIENT_ID = getenv("SPOTIFY_CLIENT_ID", None)
SPOTIFY_CLIENT_SECRET = getenv("SPOTIFY_CLIENT_SECRET", None)
# Maximum number of video calls allowed on bot. You can later set it via /set_video_limit on telegram
VIDEO_STREAM_LIMIT = int(getenv("VIDEO_STREAM_LIMIT", "3"))
# Maximum Limit Allowed for users to save playlists on bot's server
SERVER_PLAYLIST_LIMIT = int(getenv("SERVER_PLAYLIST_LIMIT", "30"))
# MaximuM limit for fetching playlist's track from youtube, spotify, apple links.
PLAYLIST_FETCH_LIMIT = int(getenv("PLAYLIST_FETCH_LIMIT", "25"))
# Cleanmode time after which bot will delete its old messages from chats
CLEANMODE_DELETE_MINS = int(
getenv("CLEANMODE_MINS", "5")
) # Remember to give value in Seconds
# Telegram audio and video file size limit
TG_AUDIO_FILESIZE_LIMIT = int(
getenv("TG_AUDIO_FILESIZE_LIMIT", "104857600")
) # Remember to give value in bytes
TG_VIDEO_FILESIZE_LIMIT = int(
getenv("TG_VIDEO_FILESIZE_LIMIT", "1073741824")
) # Remember to give value in bytes
# Chceckout https://www.gbmb.org/mb-to-bytes for converting mb to bytes
# You'll need a Pyrogram String Session for these vars. Generate String from our session generator bot @YukkiStringBot
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)
# __ ___ _ _ ___ _______ __ __ _ _ _____ _____ _____ ____ ____ _______
# \ \ / / | | | |/ / |/ /_ _| | \/ | | | |/ ____|_ _/ ____| | _ \ / __ \__ __|
# \ \_/ /| | | | ' /| ' / | | | \ / | | | | (___ | || | | |_) | | | | | |
# \ / | | | | < | < | | | |\/| | | | |\___ \ | || | | _ <| | | | | |
# | | | |__| | . \| . \ _| |_ | | | | |__| |____) |_| || |____ | |_) | |__| | | |
# |_| \____/|_|\_\_|\_\_____| |_| |_|\____/|_____/|_____\_____| |____/ \____/ |_|
### DONT TOUCH or EDIT codes after this line
BANNED_USERS = filters.user()
YTDOWNLOADER = 1
LOG = 2
LOG_FILE_NAME = "Yukkilogs.txt"
adminlist = {}
lyrical = {}
chatstats = {}
userstats = {}
clean = {}
autoclean = []
# Images
START_IMG_URL = getenv("START_IMG_URL", None)
PING_IMG_URL = getenv(
"PING_IMG_URL",
"assets/Ping.jpeg",
)
PLAYLIST_IMG_URL = getenv(
"PLAYLIST_IMG_URL",
"assets/Playlist.jpeg",
)
GLOBAL_IMG_URL = getenv(
"GLOBAL_IMG_URL",
"assets/Global.jpeg",
)
STATS_IMG_URL = getenv(
"STATS_IMG_URL",
"assets/Stats.jpeg",
)
TELEGRAM_AUDIO_URL = getenv(
"TELEGRAM_AUDIO_URL",
"assets/Audio.jpeg",
)
TELEGRAM_VIDEO_URL = getenv(
"TELEGRAM_VIDEO_URL",
"assets/Video.jpeg",
)
STREAM_IMG_URL = getenv(
"STREAM_IMG_URL",
"assets/Stream.jpeg",
)
SOUNCLOUD_IMG_URL = getenv(
"SOUNCLOUD_IMG_URL",
"assets/Soundcloud.jpeg",
)
YOUTUBE_IMG_URL = getenv(
"YOUTUBE_IMG_URL",
"assets/Youtube.jpeg",
)
SPOTIFY_ARTIST_IMG_URL = getenv(
"SPOTIFY_ARTIST_IMG_URL",
"assets/SpotifyArtist.jpeg",
)
SPOTIFY_ALBUM_IMG_URL = getenv(
"SPOTIFY_ALBUM_IMG_URL",
"assets/SpotifyAlbum.jpeg",
)
SPOTIFY_PLAYLIST_IMG_URL = getenv(
"SPOTIFY_PLAYLIST_IMG_URL",
"assets/SpotifyPlaylist.jpeg",
)
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"))
SONG_DOWNLOAD_DURATION_LIMIT = int(
time_to_seconds(f"{SONG_DOWNLOAD_DURATION}:00")
)
if SUPPORT_CHANNEL:
if not re.match("(?:http|https)://", SUPPORT_CHANNEL):
print(
"[ERROR] - Your SUPPORT_CHANNEL url is wrong. Please ensure that it starts with https://"
)
sys.exit()
if SUPPORT_GROUP:
if not re.match("(?:http|https)://", SUPPORT_GROUP):
print(
"[ERROR] - Your SUPPORT_GROUP url is wrong. Please ensure that it starts with https://"
)
sys.exit()
if UPSTREAM_REPO:
if not re.match("(?:http|https)://", UPSTREAM_REPO):
print(
"[ERROR] - Your UPSTREAM_REPO url is wrong. Please ensure that it starts with https://"
)
sys.exit()
if GITHUB_REPO:
if not re.match("(?:http|https)://", GITHUB_REPO):
print(
"[ERROR] - Your GITHUB_REPO url is wrong. Please ensure that it starts with https://"
)
sys.exit()
if PING_IMG_URL:
if PING_IMG_URL != "assets/Ping.jpeg":
if not re.match("(?:http|https)://", PING_IMG_URL):
print(
"[ERROR] - Your PING_IMG_URL url is wrong. Please ensure that it starts with https://"
)
sys.exit()
if PLAYLIST_IMG_URL:
if PLAYLIST_IMG_URL != "assets/Playlist.jpeg":
if not re.match("(?:http|https)://", PLAYLIST_IMG_URL):
print(
"[ERROR] - Your PLAYLIST_IMG_URL url is wrong. Please ensure that it starts with https://"
)
sys.exit()
if GLOBAL_IMG_URL:
if GLOBAL_IMG_URL != "assets/Global.jpeg":
if not re.match("(?:http|https)://", GLOBAL_IMG_URL):
print(
"[ERROR] - Your GLOBAL_IMG_URL url is wrong. Please ensure that it starts with https://"
)
sys.exit()
if STATS_IMG_URL:
if STATS_IMG_URL != "assets/Stats.jpeg":
if not re.match("(?:http|https)://", STATS_IMG_URL):
print(
"[ERROR] - Your STATS_IMG_URL url is wrong. Please ensure that it starts with https://"
)
sys.exit()
if TELEGRAM_AUDIO_URL:
if TELEGRAM_AUDIO_URL != "assets/Audio.jpeg":
if not re.match("(?:http|https)://", TELEGRAM_AUDIO_URL):
print(
"[ERROR] - Your TELEGRAM_AUDIO_URL url is wrong. Please ensure that it starts with https://"
)
sys.exit()
if STREAM_IMG_URL:
if STREAM_IMG_URL != "assets/Stream.jpeg":
if not re.match("(?:http|https)://", STREAM_IMG_URL):
print(
"[ERROR] - Your STREAM_IMG_URL url is wrong. Please ensure that it starts with https://"
)
sys.exit()
if SOUNCLOUD_IMG_URL:
if SOUNCLOUD_IMG_URL != "assets/Soundcloud.jpeg":
if not re.match("(?:http|https)://", SOUNCLOUD_IMG_URL):
print(
"[ERROR] - Your SOUNCLOUD_IMG_URL url is wrong. Please ensure that it starts with https://"
)
sys.exit()
if YOUTUBE_IMG_URL:
if YOUTUBE_IMG_URL != "assets/Youtube.jpeg":
if not re.match("(?:http|https)://", YOUTUBE_IMG_URL):
print(
"[ERROR] - Your YOUTUBE_IMG_URL url is wrong. Please ensure that it starts with https://"
)
sys.exit()
if TELEGRAM_VIDEO_URL:
if TELEGRAM_VIDEO_URL != "assets/Video.jpeg":
if not re.match("(?:http|https)://", TELEGRAM_VIDEO_URL):
print(
"[ERROR] - Your TELEGRAM_VIDEO_URL url is wrong. Please ensure that it starts with https://"
)
sys.exit()
if not MUSIC_BOT_NAME.isascii():
print(
"[ERROR] - You've defined MUSIC_BOT_NAME wrong. Please don't use any special characters or Special font for this... Keep it simple and small."
)
sys.exit()