Ultroid v0.3 Updates
Co-authored-by: Aditya <xditya@ultroid.tech> Co-authored-by: Danish <danish@ultroid.tech> Co-authored-by: Amit Sharma <48654350+buddhhu@users.noreply.github.com> Co-authored-by: TechiError <error@notavailable.live> Co-authored-by: Avish Kumar <85635883+aviskumar@users.noreply.github.com> Co-authored-by: Vɪɴᴀʏᴀᴋ Pᴀɴᴅᴇʏ <87496159+harpia-vieillot@users.noreply.github.com> Co-authored-by: Shrimadhav U K <6317196+spechide@users.noreply.github.com> Co-authored-by: Dark <darkbeamer.official@gmail.com> Co-authored-by: Muhamad Risman Aziz <62795826+mrismanaziz@users.noreply.github.com> Co-authored-by: Ashik Muhammed <84127769+MR-JINN-OF-TG@users.noreply.github.com> Co-authored-by: MMETMA <79155572+MMETMA@users.noreply.github.com> Co-authored-by: amirmehdinzri <94852182+amirmehdinzri@users.noreply.github.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
# Ultroid - UserBot
|
||||
# Copyright (C) 2021 TeamUltroid
|
||||
# Copyright (C) 2021-2022 TeamUltroid
|
||||
#
|
||||
# This file is a part of < https://github.com/TeamUltroid/Ultroid/ >
|
||||
# PLease read the GNU Affero General Public License in
|
||||
@@ -27,7 +27,7 @@ from pyUltroid.functions.tools import create_tl_btn, format_btn, get_msg_button
|
||||
from telegraph import upload_file as uf
|
||||
from telethon.utils import pack_bot_file_id
|
||||
|
||||
from . import eor, events, get_string, mediainfo, ultroid_bot, ultroid_cmd
|
||||
from . import events, get_string, mediainfo, udB, ultroid_bot, ultroid_cmd
|
||||
from ._inline import something
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ async def an(e):
|
||||
wt = await e.get_reply_message()
|
||||
chat = e.chat_id
|
||||
if not (wt and wrd):
|
||||
return await eor(e, get_string("notes_1"), time=5)
|
||||
return await e.eor(get_string("notes_1"), time=5)
|
||||
if "#" in wrd:
|
||||
wrd = wrd.replace("#", "")
|
||||
btn = format_btn(wt.buttons) if wt.buttons else None
|
||||
@@ -50,7 +50,7 @@ async def an(e):
|
||||
m = "https://telegra.ph" + variable[0]
|
||||
elif wut == "video":
|
||||
if wt.media.document.size > 8 * 1000 * 1000:
|
||||
return await eor(e, get_string("com_4"), time=5)
|
||||
return await e.eor(get_string("com_4"), time=5)
|
||||
dl = await wt.download_media()
|
||||
variable = uf(dl)
|
||||
os.remove(dl)
|
||||
@@ -61,15 +61,16 @@ async def an(e):
|
||||
txt = wt.text
|
||||
if not btn:
|
||||
txt, btn = get_msg_button(wt.text)
|
||||
add_note(int(chat), wrd, txt, m, btn)
|
||||
add_note(chat, wrd, txt, m, btn)
|
||||
else:
|
||||
add_note(int(chat), wrd, None, m, btn)
|
||||
add_note(chat, wrd, None, m, btn)
|
||||
else:
|
||||
txt = wt.text
|
||||
if not btn:
|
||||
txt, btn = get_msg_button(wt.text)
|
||||
add_note(int(chat), wrd, txt, None, btn)
|
||||
await eor(e, get_string("notes_2").format(wrd))
|
||||
add_note(chat, wrd, txt, None, btn)
|
||||
await e.eor(get_string("notes_2").format(wrd))
|
||||
ultroid_bot.add_handler(notes, events.NewMessage())
|
||||
|
||||
|
||||
@ultroid_cmd(pattern="remnote ?(.*)", admins_only=True)
|
||||
@@ -77,11 +78,11 @@ async def rn(e):
|
||||
wrd = (e.pattern_match.group(1)).lower()
|
||||
chat = e.chat_id
|
||||
if not wrd:
|
||||
return await eor(e, get_string("notes_3"), time=5)
|
||||
return await e.eor(get_string("notes_3"), time=5)
|
||||
if wrd.startswith("#"):
|
||||
wrd = wrd.replace("#", "")
|
||||
rem_note(int(chat), wrd)
|
||||
await eor(e, f"Done Note: `#{wrd}` Removed.")
|
||||
await e.eor(f"Done Note: `#{wrd}` Removed.")
|
||||
|
||||
|
||||
@ultroid_cmd(pattern="listnote$", admins_only=True)
|
||||
@@ -89,11 +90,10 @@ async def lsnote(e):
|
||||
x = list_note(e.chat_id)
|
||||
if x:
|
||||
sd = "Notes Found In This Chats Are\n\n"
|
||||
return await eor(e, sd + x)
|
||||
await eor(e, get_string("notes_5"))
|
||||
return await e.eor(sd + x)
|
||||
await e.eor(get_string("notes_5"))
|
||||
|
||||
|
||||
@ultroid_bot.on(events.NewMessage())
|
||||
async def notes(e):
|
||||
xx = [z.replace("#", "") for z in e.text.lower().split() if z.startswith("#")]
|
||||
for word in xx:
|
||||
@@ -105,3 +105,7 @@ async def notes(e):
|
||||
btn = create_tl_btn(k["button"])
|
||||
return await something(e, msg, media, btn)
|
||||
await e.reply(msg, file=media)
|
||||
|
||||
|
||||
if udB.get_key("NOTE"):
|
||||
ultroid_bot.add_handler(notes, events.NewMessage())
|
||||
|
||||
Reference in New Issue
Block a user