Spaces:
Paused
Paused
Delete plugins/allive.py
Browse files- plugins/allive.py +0 -169
plugins/allive.py
DELETED
@@ -1,169 +0,0 @@
|
|
1 |
-
import os
|
2 |
-
import asyncio
|
3 |
-
import platform
|
4 |
-
import subprocess
|
5 |
-
import time
|
6 |
-
import random
|
7 |
-
from datetime import datetime
|
8 |
-
from secrets import choice
|
9 |
-
from telethon import Button, events
|
10 |
-
from telethon.errors.rpcerrorlist import MessageDeleteForbiddenError
|
11 |
-
from telethon.utils import get_display_name
|
12 |
-
from telethon.errors.rpcerrorlist import MessageDeleteForbiddenError
|
13 |
-
from telethon.utils import get_display_name
|
14 |
-
from telethon.tl.types import InputMessagesFilterVideo, InputMessagesFilterVoice, InputMessagesFilterPhotos
|
15 |
-
|
16 |
-
from xteam._misc import SUDO_M, owner_and_sudos
|
17 |
-
from xteam.dB.base import KeyManager
|
18 |
-
from xteam.fns.helper import inline_mention
|
19 |
-
from strings import get_string
|
20 |
-
|
21 |
-
from xteam._misc import SUDO_M, owner_and_sudos
|
22 |
-
from xteam.dB.base import KeyManager
|
23 |
-
from xteam.fns.helper import inline_mention
|
24 |
-
|
25 |
-
from platform import python_version as pyver
|
26 |
-
from pyrogram import __version__ as pver
|
27 |
-
from telegram import __version__ as lver
|
28 |
-
from telethon import __version__ as tver
|
29 |
-
from pytgcalls import __version__ as pytver
|
30 |
-
from pyrogram import filters
|
31 |
-
from pyrogram.types import Message
|
32 |
-
from telethon import TelegramClient, events
|
33 |
-
from telethon.tl.custom import Button
|
34 |
-
from . import *
|
35 |
-
from . import ultroid_bot as client
|
36 |
-
import resources
|
37 |
-
from xteam.fns.helper import inline_mention
|
38 |
-
from . import (
|
39 |
-
OWNER_NAME,
|
40 |
-
OWNER_ID,
|
41 |
-
BOT_NAME,
|
42 |
-
OWNER_USERNAME,
|
43 |
-
asst,
|
44 |
-
start_time,
|
45 |
-
time_formatter,
|
46 |
-
udB,
|
47 |
-
ultroid_cmd as xteam_cmd,
|
48 |
-
get_string,
|
49 |
-
ultroid_bot as client,
|
50 |
-
eor,
|
51 |
-
ultroid_bot,
|
52 |
-
call_back,
|
53 |
-
callback,
|
54 |
-
HOSTED_ON,
|
55 |
-
)
|
56 |
-
|
57 |
-
async def member_permissions(chat_id: int, user_id: int):
|
58 |
-
perms = []
|
59 |
-
member = (await ultroid_bot.get_chat_member(chat_id, user_id)).privileges
|
60 |
-
if not member:
|
61 |
-
return []
|
62 |
-
if member.can_post_messages:
|
63 |
-
perms.append("can_post_messages")
|
64 |
-
if member.can_edit_messages:
|
65 |
-
perms.append("can_edit_messages")
|
66 |
-
if member.can_delete_messages:
|
67 |
-
perms.append("can_delete_messages")
|
68 |
-
if member.can_restrict_members:
|
69 |
-
perms.append("can_restrict_members")
|
70 |
-
if member.can_promote_members:
|
71 |
-
perms.append("can_promote_members")
|
72 |
-
if member.can_change_info:
|
73 |
-
perms.append("can_change_info")
|
74 |
-
if member.can_invite_users:
|
75 |
-
perms.append("can_invite_users")
|
76 |
-
if member.can_pin_messages:
|
77 |
-
perms.append("can_pin_messages")
|
78 |
-
if member.can_manage_video_chats:
|
79 |
-
perms.append("can_manage_video_chats")
|
80 |
-
return perms
|
81 |
-
|
82 |
-
PHOTO = [
|
83 |
-
"https://files.catbox.moe/fqx4vz.mp4"
|
84 |
-
]
|
85 |
-
|
86 |
-
Mukesh = [
|
87 |
-
[
|
88 |
-
Button.url("ɴᴏᴏʙ", url=f"https://t.me/{OWNER_USERNAME}"),
|
89 |
-
Button.url("ꜱᴜᴘᴘᴏʀᴛ", url=f"https://t.me/xteam_cloner"),
|
90 |
-
],
|
91 |
-
[
|
92 |
-
Button.url("➕ᴀᴅᴅ ᴍᴇ ᴇʟsᴇ ʏᴏᴜʀ ɢʀᴏᴜᴘ➕",
|
93 |
-
url=f"https://t.me/{BOT_USERNAME}?startgroup=true",
|
94 |
-
),
|
95 |
-
],
|
96 |
-
]
|
97 |
-
|
98 |
-
"""def format_message_text(uptime):
|
99 |
-
return f"<blockquote>ʜᴇʏ, ɪ ᴀᴍ {BOT_NAME} 🥀</blockquote>\n" \
|
100 |
-
f"<blockquote>❍ ᴍʏ ᴏᴡɴᴇʀ : {OWNER_NAME}\n" \
|
101 |
-
f"❍ ʟɪʙʀᴀʀʏ : {lver}\n" \
|
102 |
-
f"❍ ᴜᴘᴛɪᴍᴇ : {uptime}\n" \
|
103 |
-
f"❍ ᴛᴇʟᴇᴛʜᴏɴ : {tver}\n" \
|
104 |
-
f"❍ ᴘʏʀᴏɢʀᴀᴍ : {pver}\n" \
|
105 |
-
f"❍ ᴘʏ-ᴛɢᴄᴀʟʟꜱ : {pytver}\n" \
|
106 |
-
f"❍ ᴘʏᴛʜᴏɴ : {pyver()}\n</blockquote>"
|
107 |
-
"""
|
108 |
-
|
109 |
-
def format_message_text(uptime):
|
110 |
-
return f"<blockquote>┏──────────────────┓\n❍─┫ᴜʀʙᴏᴛ ɪꜱ ɴᴏᴡ ᴀʟɪᴠᴇ!┣─❍\n" \
|
111 |
-
f"┣──────────────────┫\n" \
|
112 |
-
f"❍ ᴏᴡɴᴇʀ : {OWNER_NAME}\n" \
|
113 |
-
f"❍ ʟɪʙʀᴀʀʏ : {lver}\n" \
|
114 |
-
f"❍ ᴜᴘᴛɪᴍᴇ : {uptime}\n" \
|
115 |
-
f"❍ ᴛᴇʟᴇᴛʜᴏɴ : {tver}\n" \
|
116 |
-
f"❍ ᴘʏʀᴏɢʀᴀᴍ : {pver}\n" \
|
117 |
-
f"❍ ᴘʏᴛʜᴏɴ : {pyver()}\n" \
|
118 |
-
f"┗──────────────────┛\n</blockquote>"
|
119 |
-
|
120 |
-
@xteam_cmd(pattern="alive$")
|
121 |
-
async def alive(event):
|
122 |
-
start = time.time()
|
123 |
-
pro = await event.eor("♥️")
|
124 |
-
await asyncio.sleep(2)
|
125 |
-
end = round((time.time() - start) * 1000)
|
126 |
-
uptime = time_formatter((time.time() - start_time) * 1000)
|
127 |
-
message_text = format_message_text(uptime)
|
128 |
-
await pro.edit(f"<blockquote>┏──────────────────┓\n❍── xᴛᴇᴀᴍ-ᴜʀʙᴏᴛ ᴀʟɪᴠᴇ! ──❍\n" \
|
129 |
-
f"┣──────────────────┫\n" \
|
130 |
-
f"❍ ᴏᴡɴᴇʀ : {OWNER_NAME}\n" \
|
131 |
-
f"❍ ʟɪʙʀᴀʀʏ : {lver} [{HOSTED_ON}]\n" \
|
132 |
-
f"❍ ᴜᴘᴛɪᴍᴇ : {uptime}\n" \
|
133 |
-
f"❍ ᴛᴇʟᴇᴛʜᴏɴ : {tver}\n" \
|
134 |
-
f"❍ ᴘʏʀᴏɢʀᴀᴍ : {pver}\n" \
|
135 |
-
f"❍ ᴘʏᴛʜᴏɴ : {pyver()}\n" \
|
136 |
-
f"┗──────────────────┛\n</blockquote>",
|
137 |
-
parse_mode="html")
|
138 |
-
|
139 |
-
@xteam_cmd(pattern="Alive$")
|
140 |
-
async def alive_video(event):
|
141 |
-
try:
|
142 |
-
asupannya = [
|
143 |
-
asupan
|
144 |
-
async for asupan in event.client.iter_messages(
|
145 |
-
"@xcryasupan", filter=InputMessagesFilterVideo
|
146 |
-
)
|
147 |
-
]
|
148 |
-
|
149 |
-
if not asupannya:
|
150 |
-
await event.respond("No video found in @xcryasupan.")
|
151 |
-
return
|
152 |
-
|
153 |
-
pro = await event.eor("⚡")
|
154 |
-
await asyncio.sleep(2)
|
155 |
-
await pro.delete()
|
156 |
-
|
157 |
-
uptime = time_formatter((time.time() - start_time) * 1000)
|
158 |
-
message_text = format_message_text(uptime)
|
159 |
-
|
160 |
-
await asst.send_file(
|
161 |
-
event.chat.id,
|
162 |
-
file=random.choice(asupannya),
|
163 |
-
caption=message_text,
|
164 |
-
parse_mode="html",
|
165 |
-
)
|
166 |
-
|
167 |
-
except Exception as e:
|
168 |
-
await event.respond(f"An error occurred: {e}")
|
169 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|