Skip to content

Commit

Permalink
Update autoleave.py
Browse files Browse the repository at this point in the history
  • Loading branch information
TheTeamAlexa authored Nov 30, 2023
1 parent a3244a1 commit 8d5ba20
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions AlexaMusic/plugins/misc/autoleave.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,21 +79,3 @@ async def auto_end():

asyncio.create_task(auto_end())

# Code and idea by @EVERYONExKSKOP auto leave if bot is on mute

async def alexa_leave():
try:
if await is_muted(chat_id):
muted_time = await is_muted(chat_id)
current_time = datetime.now()
if current_time - muted_time > timedelta(minutes=1):
await client.leave_chat(chat_id)
await Alexa.stop_stream(chat_id)
await app.send_message(
chat_id,
"ᴀʟᴇxᴀ ɪs ᴍᴜᴛᴇᴅ ꜰʀᴏᴍ ᴛʜᴇ ʟᴀsᴛ ᴏɴᴇ ᴍɪɴᴜᴛᴇ, sᴏ ɪᴛ's ʟᴇᴀᴠɪɴɢ ᴠᴏɪᴄᴇ ᴄʜᴀᴛ."
)
except Exception as e:
await app.send_message(chat_id, f"ᴇʀʀᴏʀ ɪɴ ʟᴇᴀᴠɪɴɢ ᴄʜᴀᴛ: {str(e)}")

asyncio.create_task(alexa_leave())

0 comments on commit 8d5ba20

Please sign in to comment.