Skip to content

Commit

Permalink
Merge branch 'ashwinstr:alpha' into alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
notashwin authored Feb 24, 2024
2 parents aaf3ed7 + dc5ae89 commit ea38ce5
Show file tree
Hide file tree
Showing 15 changed files with 297 additions and 241 deletions.
44 changes: 25 additions & 19 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,35 +1,33 @@
aiofiles>=0.6.0
aiohttp[speedups]>=3.7.3
asyncurban
aiohttp[speedups]>=3.8.1
asyncurban>=0.3.3
beautifulsoup4>=4.9.1
colour
colour>=0.1.5
cowpy>=1.1.0
dnspython>=2.0.0
futures==2.2.0
dnspython==2.3.0
futures>=3.0.5
gitpython>=3.1.11
google-api-python-client>=1.12.8
google-auth-httplib2>=0.0.4
google-auth-oauthlib>=0.4.2
git+https://github.com/Joeclinton1/google-images-download@patch-1
googletrans==3.1.0a0
gtts
gtts>=2.2.4
hachoir>=3.1.1
heroku3>=4.2.3
html-telegraph-poster>=0.2.31
lyricsgenius
motor>=2.3.0
music_tag
numpy
nekosbest
motor==3.2.0
pymongo==4.4.0
music_tag>=0.4.3
numpy>=1.23.2
oauth2client>=4.1.3
Pillow==9.0.1
psutil>=5.7.3
pybase64>=1.1.1
PyDictionary>=2.0.1
pymediainfo
pymediainfo>=5.1.0
git+https://github.com/ashwinstr/pyrogram.git@x21
# git+https://github.com/pyrogram/pyrogram.git@master
# pyrogram==1.4.7
pySmartDL>=1.3.4
python-dotenv>=0.15.0
pytz>=2020.4
Expand All @@ -40,17 +38,25 @@ search-engine-parser
selenium==3.141.0
setuptools>=60.0.4
spamwatch>=0.3.0
speedtest-cli>=2.1.3
stagger>=1.0.0
#speedtest-cli>=2.1.3
git+https://github.com/Notmarrco/speedtest-cli
git+https://github.com/MichaelCook/stagger
telegraph>=1.4.1
tgcrypto
tgcrypto>=1.2.3
urbandict>=0.5
vcsi
vcsi>=7.0.13
wget>=3.2
wikipedia>=1.4.0
youtube_dl
#git+https://github.com/Nekos-life/Async-nekos.life-wrapper
yt_dlp>=2022.8.19
ruamel.yaml==0.17.21
ujson>=4.0.1
youtube-search-python==1.5.1
feedparser>=6.0.2


### Ded / Reqs with issues ###
# nekosbest
# git+https://github.com/pyrogram/pyrogram.git@master
# pyrogram==1.4.7
# youtube_dl #slow af
# git+https://github.com/Nekos-life/Async-nekos.life-wrapper
18 changes: 10 additions & 8 deletions userge/plugins/admin/gadmin.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ async def promote_usr(message: Message):
can_restrict_members=True,
can_invite_users=True,
can_pin_messages=True,
can_promote_members=True if "-full" in message.flags else False,
can_manage_voice_chats=True if "-full" in message.flags else False,
can_promote_members=("-full" in message.flags),
can_manage_voice_chats=("-full" in message.flags),
)
if custom_rank:
await asyncio.sleep(2)
Expand Down Expand Up @@ -112,14 +112,16 @@ async def demote_usr(message: Message):
return
try:
get_mem = await message.client.get_chat_member(chat_id, user_id)
await message.client.promote_chat_member(
await message.client.restrict_chat_member(
chat_id,
user_id,
ChatPermissions(),
)
await asyncio.sleep(1)
await message.client.restrict_chat_member(
chat_id,
user_id,
can_change_info=False,
can_delete_messages=False,
can_restrict_members=False,
can_invite_users=False,
can_pin_messages=False,
message.chat.permissions,
)
await message.edit("`🛡 Demoted Successfully..`", del_in=5)
await CHANNEL.log(
Expand Down
84 changes: 84 additions & 0 deletions userge/plugins/admin/myadminlist.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
"""Get Your Admin Groups and Channels"""

# For USERGE-X
# Idea : https://github.com/kantek/.../kantek/plugins/private/stats.py
# Module By: github/code-rgb [TG - @DeletedUser420]
# Modded to Admin only By: Ryuk (anonymousx97)

import asyncio

from pyrogram.errors import FloodWait, UserNotParticipant

from userge import Message, userge
from userge.utils import post_to_telegraph as pt


@userge.on_cmd(
"myadminlist",
about={"header": "List your Admin groups/channels.", "usage": "{tr}myadminlist"},
)
async def get_your_admin_list(message: Message):
"""get info about your Admin group/channels"""

await message.edit(
"💁‍♂️ `Collecting your Telegram Stats ...`\n"
"<b>Please wait it will take some time</b>"
)
owner = await userge.get_me()
groups_admin = []
groups_creator = []
channels_admin = []
channels_creator = []
try:
async for dialog in userge.iter_dialogs():
chat_type = dialog.chat.type
if chat_type not in ["bot", "private"]:
try:
is_admin = await admin_check(dialog.chat.id, owner.id)
is_creator = dialog.chat.is_creator
except UserNotParticipant:
is_admin = False
is_creator = False
if chat_type in ["group", "supergroup"]:
if is_admin:
groups_admin.append(dialog.chat.title)
if is_creator:
groups_creator.append(dialog.chat.title)
else: # Channel
if is_admin:
channels_admin.append(dialog.chat.title)
if is_creator:
channels_creator.append(dialog.chat.title)
except FloodWait as e:
await asyncio.sleep(e.x + 5)
template = f"""Admin Groups/Channels of {owner.first_name}"""
text_ = ""
if channels_creator or groups_creator:
if groups_creator:
text_ += f"""\n<h3>Owner of Groups:</h3>\n• """ + "\n• ".join(
sorted(groups_creator)
)
if channels_creator:
text_ += f"""\n\n\n<h3>Owner of Channels:</h3>\n• """ + "\n• ".join(
sorted(channels_creator)
)
if groups_admin:
text_ += f"""\n\n\n<h3>Admin in Groups:</h3>\n• """ + "\n• ".join(
sorted(groups_admin)
)
if channels_admin:
text_ += f"""\n\n\n<h3>Admin in Channels:</h3>\n• """ + "\n• ".join(
sorted(channels_admin)
)
telegraph = pt(template.replace("\n", "<br>"), text_.replace("\n", "<br>"))
await message.edit(
f"{template} : \n[📜 TELEGRAPH]({telegraph})", disable_web_page_preview=True
)


# https://git.colinshark.de/PyroBot/PyroBot/src/branch
# /master/pyrobot/modules/admin.py#L69
async def admin_check(chat_id: int, user_id: int) -> bool:
check_status = await userge.get_chat_member(chat_id, user_id)
admin_strings = ["creator", "administrator"]
return check_status.status in admin_strings
1 change: 0 additions & 1 deletion userge/plugins/admin/warns.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ async def warn_func(message: Message):
wcount += 1

if wcount >= max_warns:

if warn_mode == "mute":
warn_mode_text = "muted"
elif warn_mode == "kick":
Expand Down
1 change: 0 additions & 1 deletion userge/plugins/bot/gapps.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ async def nik_cb(_, callback_query: CallbackQuery):
async def back_cb(_, callback_query: CallbackQuery):
u_id = callback_query.from_user.id
if u_id in Config.OWNER_ID or u_id in Config.SUDO_USERS:

buttons = [
[
InlineKeyboardButton("Open Gapps", callback_data="open_gapps"),
Expand Down
1 change: 0 additions & 1 deletion userge/plugins/bot/utube_inline.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,6 @@ def download_button(vid: str, body: bool = False):
audio_dict = {}
# ------------------------------------------------ #
for video in vid_data["formats"]:

fr_note = video.get("format_note")
fr_id = int(video.get("format_id"))
fr_size = video.get("filesize")
Expand Down
2 changes: 0 additions & 2 deletions userge/plugins/fun/memes.py
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,6 @@ async def dice_gen(message: Message):

@userge.on_cmd("emoji$", about={"header": "Multiple Animated Emojis"})
async def emoji_func(message):

switch = await message.edit_text("🤔")
emoji_s = "😆 😂 😳 😒 🧐 🤔 😍 😘 🥰 🥳 😌 😮 🙄 😐 😧 😔 😢 😡 😨 🎃 🤕 🤒 😷 🤧 🤢 🤮 👍 💝 ❤ 💋 😻 🎉 🎄 👛 💎 🙈 ☃ 📁 👻 💀 🦠 🚑"

Expand All @@ -682,7 +681,6 @@ async def emoji_func(message):

@userge.on_cmd("bigoof$", about={"header": "Use when something is beyond just oof"})
async def bigf_func(message):

animation_chars = [
"`┏━━━┓╋╋╋╋┏━━━┓ \n┃┏━┓┃╋╋╋╋┃┏━┓┃ \n┃┃╋┃┣┓┏┓┏┫┃╋┃┃ \n┃┃╋┃┃┗┛┗┛┃┃╋┃┃ \n┃┗━┛┣┓┏┓┏┫┗━┛┃ \n┗━━━┛┗┛┗┛┗━━━┛`",
"`╭━━━╮╱╱╱╭━╮ \n┃╭━╮┃╱╱╱┃╭╯ \n┃┃╱┃┣━━┳╯╰╮ \n┃┃╱┃┃╭╮┣╮╭╯ \n┃╰━╯┃╰╯┃┃┃ \n╰━━━┻━━╯╰╯`",
Expand Down
1 change: 0 additions & 1 deletion userge/plugins/fun/spotify_bio.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ def save_spam(which, what):
return False

async def spotify_bio_():

while Config.SPOTIFY_MODE:
# SPOTIFY
skip = False
Expand Down
1 change: 0 additions & 1 deletion userge/plugins/help.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,6 @@ async def inline_answer(_, inline_query: InlineQuery):
)
and Config.SUDO_ENABLED
):

if string == "syntax":
owner = [
[
Expand Down
Loading

0 comments on commit ea38ce5

Please sign in to comment.