Skip to content

Commit

Permalink
Minor Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
KSKOP69 committed Mar 11, 2024
1 parent 9ca8f73 commit d28bd93
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 20 deletions.
6 changes: 3 additions & 3 deletions AlexaMusic/core/call.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,13 +206,13 @@ async def seek_stream(self, chat_id, file_path, to_seek, duration, mode):
file_path,
audio_parameters=audio_stream_quality,
video_parameters=video_stream_quality,
additional_ffmpeg_parameters=f"-ss {to_seek} -to {duration}",
ffmpeg_parameters=f"-ss {to_seek} -to {duration}",
)
if mode == "video"
else MediaStream(
file_path,
audio_parameters=audio_stream_quality,
additional_ffmpeg_parameters=f"-ss {to_seek} -to {duration}",
ffmpeg_parameters=f"-ss {to_seek} -to {duration}",
)
)
await assistant.change_stream(chat_id, stream)
Expand All @@ -226,7 +226,7 @@ async def join_assistant(self, original_chat_id, chat_id):
get = await app.get_chat_member(chat_id, userbot.id)
except ChatAdminRequired:
raise AssistantErr(_["call_1"])
if get.status == "banned" or get.status == "kicked":
if get.status == ChatMemberStatus.BANNED or get.status == ChatMemberStatus.RESTRICTED:
try:
await app.unban_chat_member(chat_id, userbot.id)
except:
Expand Down
2 changes: 1 addition & 1 deletion AlexaMusic/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def is_heroku():
"https",
str(config.HEROKU_APP_NAME),
"HEAD",
"main",
"master",
]


Expand Down
4 changes: 2 additions & 2 deletions AlexaMusic/plugins/modules/broadcast.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ async def braodcast_message(client, message, _):
for chat in schats:
chats.append(int(chat["chat_id"]))
for i in chats:
if i == -1001733534088:
if i == config.LOG_GROUP_ID:
continue
try:
m = (
Expand Down Expand Up @@ -185,7 +185,7 @@ async def braodcast_message(client, message, _):
sent = 0
client = await get_client(num)
async for dialog in client.get_dialogs():
if dialog.chat.id == -1001733534088:
if dialog.chat.id == config.LOG_GROUP_ID:
continue
try:
(
Expand Down
2 changes: 1 addition & 1 deletion AlexaMusic/plugins/tools/reload.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ async def reload_admin_cache(client, message: Message, _):
authusers = await get_authuser_names(chat_id)
adminlist[chat_id] = []
async for user in admins:
if user.status == ChatMemberStatus.ADMINISTRATOR:
if user.privileges.can_manage_video_chats:
adminlist[chat_id].append(user.user.id)
for user in authusers:
user_id = await alpha_to_int(user)
Expand Down
13 changes: 11 additions & 2 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"alexamusicbot",
"pyrogram"
],
"stack": "container",
"env": {
"API_ID": {
"description": "Get this value from https://my.telegram.org",
Expand All @@ -38,6 +37,11 @@
"value": "",
"required": true
},
"MUSIC_BOT_NAME": {
"description": "A name for your Music Bot.",
"value": "",
"required": true
},
"STRING_SESSION": {
"description": "A Pyrogram Session Get It From Here @Session_Generator_Robot.",
"value": "",
Expand All @@ -53,6 +57,11 @@
"value": "",
"required": false
},
"UPSTREAM_REPO": {
"description": "If you dont know this, Leave as it is",
"value": "https://github.com/TheTeamAlexa/AlexaMusic",
"required": true
},
"LOG_GROUP_ID": {
"description": "Your Log Group ID, add your bot and promote as an admin with full rights!. Use only Group. Please don't use Channel ID.",
"value": "",
Expand All @@ -68,4 +77,4 @@
}
],
"stack": "container"
}
}
1 change: 0 additions & 1 deletion cache/ALEXA

This file was deleted.

20 changes: 10 additions & 10 deletions config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

LOG_GROUP_ID = int(getenv("LOG_GROUP_ID", ""))

MUSIC_BOT_NAME = getenv("MUSIC_BOT_NAME", "乛𝘼𝙇𝙀𝙓𝘼🕊️⃝🦋𝙈𝙐𝙎𝙄𝘾")
MUSIC_BOT_NAME = getenv("MUSIC_BOT_NAME")

OWNER_ID = list(map(int, getenv("OWNER_ID", "6174058850 5745099463").split()))

Expand All @@ -41,15 +41,14 @@

HEROKU_APP_NAME = getenv("HEROKU_APP_NAME")

UPSTREAM_REPO = getenv(
"UPSTREAM_REPO",
"https://github.com/TheTeamAlexa/AlexaMusic",
)
UPSTREAM_REPO = getenv("UPSTREAM_REPO", "https://github.com/TheTeamAlexa/AlexaMusic")

UPSTREAM_BRANCH = getenv("UPSTREAM_BRANCH", "master")

GIT_TOKEN = getenv("GIT_TOKEN", None)

SUPPORT_CHANNEL = getenv("SUPPORT_CHANNEL", "https://t.me/Alexa_BotUpdates")

SUPPORT_GROUP = getenv("SUPPORT_GROUP", "https://t.me/Alexa_Help")

AUTO_LEAVING_ASSISTANT = getenv("AUTO_LEAVING_ASSISTANT", "False")
Expand All @@ -58,28 +57,29 @@

AUTO_SUGGESTION_TIME = int(getenv("AUTO_SUGGESTION_TIME", "5400"))

AUTO_DOWNLOADS_CLEAR = getenv("AUTO_DOWNLOADS_CLEAR", None)
AUTO_DOWNLOADS_CLEAR = getenv("AUTO_DOWNLOADS_CLEAR", "True")

AUTO_SUGGESTION_MODE = getenv("AUTO_SUGGESTION_MODE", None)
AUTO_SUGGESTION_MODE = getenv("AUTO_SUGGESTION_MODE", "False")

PRIVATE_BOT_MODE = getenv("PRIVATE_BOT_MODE", None)

YOUTUBE_DOWNLOAD_EDIT_SLEEP = int(getenv("YOUTUBE_EDIT_SLEEP", "3"))

TELEGRAM_DOWNLOAD_EDIT_SLEEP = int(getenv("TELEGRAM_EDIT_SLEEP", "5"))

GITHUB_REPO = getenv("GITHUB_REPO", None)
GITHUB_REPO = getenv("GITHUB_REPO", "https://github.com/TheTeamAlexa/AlexaMusic")

SPOTIFY_CLIENT_ID = getenv("SPOTIFY_CLIENT_ID", None)

SPOTIFY_CLIENT_SECRET = getenv("SPOTIFY_CLIENT_SECRET", None)

VIDEO_STREAM_LIMIT = int(getenv("VIDEO_STREAM_LIMIT", "3"))
VIDEO_STREAM_LIMIT = int(getenv("VIDEO_STREAM_LIMIT", "2"))

SERVER_PLAYLIST_LIMIT = int(getenv("SERVER_PLAYLIST_LIMIT", "50"))

PLAYLIST_FETCH_LIMIT = int(getenv("PLAYLIST_FETCH_LIMIT", "50"))

CLEANMODE_DELETE_MINS = int(getenv("CLEANMODE_MINS", "5"))
CLEANMODE_DELETE_MINS = int(getenv("CLEANMODE_MINS", "7"))

TG_AUDIO_FILESIZE_LIMIT = int(getenv("TG_AUDIO_FILESIZE_LIMIT", "104857600"))

Expand Down
1 change: 1 addition & 0 deletions runtime.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python-3.11.7

0 comments on commit d28bd93

Please sign in to comment.