count the file_size of the files in a chat
#PyroGram
#TeleThon
ℹ️ @UniBorg
#PyroGram
def gfi(m):
ts = ("audio", "photo", "video", "document")
for u in ts:
k = getattr(m, u, None)
if k:
return k
humanbytes = lambda a: a
status_message = await message.reply_text("🤔")
mus = 0
sum = 0
async for message in client.iter_history(message.chat.id, limit=None):
d = gfi(message)
if message and d:
mus += d.file_size
sum += 1
await status_message.edit_message_text(humanbytes(mus)) +
print(sum)
#TeleThon
status_message = await message.reply("🤔")
mus = 0
sum = 0
async for message in client.iter_messages(entity=message.chat_id, limit=None):
if message and message.file:
mus += message.file.size
sum += 1
await status_message.edit(slitu.humanbytes(mus))
p(sum)
ℹ️ @UniBorg
send all stickers in a particular pack,
#Telethon
#PyroGram
ℹ @UniBorg
#Telethon
pack_short_name = "AnimatedEmojies"
sleep_delay = 5
import asyncio
from telethon.tl import functions, types
reqd_sticker_set = await message.client(functions.messages.GetStickerSetRequest(stickerset=types.InputStickerSetShortName(short_name=pack_short_name)))
for m in reqd_sticker_set.documents:
await message.client(functions.messages.SendMediaRequest(
peer=message.chat_id,
media=types.InputMediaDocument(id=types.InputDocument(id=m.id, access_hash=m.access_hash, file_reference=m.file_reference)),
message=m.attributes[1].alt,
random_id=42))
await asyncio.sleep(sleep_delay)
#PyroGram
pack_short_name = "AnimatedEmojies"
sleep_delay = 5
import asyncio
from pyrogram.raw import functions, types
reqd_sticker_set = await client.send(functions.messages.GetStickerSet(stickerset=types.InputStickerSetShortName(short_name=pack_short_name)))
for m in reqd_sticker_set.documents:
await client.send(functions.messages.SendMedia(
peer=(await client.resolve_peer(message.chat.id)),
media=types.InputMediaDocument(id=types.InputDocument(id=m.id, access_hash=m.access_hash, file_reference=m.file_reference)),
message=m.attributes[1].alt,
random_id=client.rnd_id()))
await asyncio.sleep(sleep_delay)
ℹ @UniBorg
are you still using @UniBorg?
please reply, for any missing features, that I should add! 😁😬😬
please reply, for any missing features, that I should add! 😁😬😬
Anonymous Poll
49%
no. __the forks are better__
37%
yes
14%
but
🤔 How Telegram knows which sounds to play when tapping on a big emoji?
from telethon.utils import _decode_telegram_base64ℹ️ @UniBorg
from telethon.tl.functions.help import GetAppConfigRequest
res = await client(GetAppConfigRequest())
sre = (
next(
(
x for x in res.value if x.key == 'emojies_sounds'
)
)
).value.value
for kro in sre:
d = {
x.key: x.value.value for x in kro.value.value
}
emojies_sounds_message = await message.respond(kro.key)
await emojies_sounds_message.reply(
ascii(kro.key),
file=types.InputMediaDocument(
id=types.InputDocument(
int(d.get("id")),
int(d.get("access_hash")),
_decode_telegram_base64(
d.get("file_reference_base64")
)
)
)
)
😬 get number of contacts, using Telegram?
😳 It will be fun to see that statistics, so please reply to this message 😁😝
p(len((await client(functions.contacts.GetContactsRequest(0))).contacts))
😳 It will be fun to see that statistics, so please reply to this message 😁😝
UniBorg via @googleimgbot
UniBorg
😬 How to Deploy your UserBot to Heroku? YOU ABSOLUTELY MUST READ THE ENTIRE STEPS, AND NOT SKIM THROUGH ANY OF IT! 👉 https://t.me/UniBorg/11 👉 https://github.com/SpEcHiDe/UniBorg/wiki 👉 Done. Your UserBot is alive. Check with .helpme in any chat. ℹ️…
Telegraph
y UserRoBots exist on Telegram?
Many Telegram users were complaining that their account was getting banned by using @UniBorg. Unfortunately, this is a misconception, and this article attempts to fix these misconceptions, and probably understand why Telegram accounts were getting banned.…
scrap streams from https://radiosindia.com/
©️ @PlayASong 🈯️
import aiohttp
import re
from asyncio import sleep
from bs4 import BeautifulSoup
import json
base_url = "https://radiosindia.com/"
mr = "malayalamradio.html"
first_url = base_url + mr
a = {}
async with aiohttp.ClientSession() as requests:
first_response = await (await requests.get(first_url)).text()
soup_one = BeautifulSoup(first_response, "html.parser")
online_stations = soup_one.find_all("div", {"class": "grid_1_of_2"})
for each_stn in online_stations:
bn = each_stn.find("a").get("href")
scnd_url = base_url + bn
stn_response = await (await requests.get(scnd_url)).text()
radio_stn_uri__ = re.search("var player \= .*file\:\"(.*)\"\,.*", stn_response)
if radio_stn_uri__:
radio_stn_uri = radio_stn_uri__.group(1)
a[bn] = radio_stn_uri
print(json.dumps(a, sort_keys=True, indent=4))
©️ @PlayASong 🈯️
⚠ Potential security issue that does not affect @UniBorg 🧐
There may be a security issue introduced by a future telegram update.
If you are running a userbot that allows executing commands from a forwarded message (ub does not), I suggest disabling it (at least temporarily) to be sure of the security of your account.
To userbot maintainers: please ignore all forwarded messages!
There may be a security issue introduced by a future telegram update.
If you are running a userbot that allows executing commands from a forwarded message (ub does not), I suggest disabling it (at least temporarily) to be sure of the security of your account.
To userbot maintainers: please ignore all forwarded messages!
create recursive stickers using
it is forbidden to abuse, spam, or by any means consume, content without explicit permission from the developer of
ℹ️ @UniBorg
@QuotlyBot
from asyncio import sleep
r_limit = 7
for o in range(r_limit):
await reply.reply("/q")
await sleep(o)
reply = (
await client.get_messages(
entity=message.chat_id,
from_user="@QuotLyBot"
)
)[0]
it is forbidden to abuse, spam, or by any means consume, content without explicit permission from the developer of
@QuotlyBot
. UniBorg is not associated nor affiliated with this third party Telegram bot and does not endorse any use of it. If you believe this snippet is spammy, please reply to this message to get it removed.ℹ️ @UniBorg
kick all users in groups based on number of messages
ℹ @UniBorg
async for u in client.iter_participants(message.chat_id, limit=None):
if u and not u.deleted:
k = (await client.get_messages(message.chat_id, limit=0, from_user=u)).total
await message.respond(f"{u.id} has sent {k} messages. Kicking.")
await client.kick_participant(message.chat_id, u)
ℹ @UniBorg
😡 have you accidentally left your private channel 😐, and want to re-join 🤔😅
ℹ @UniBorg
channel_name = "@uniborg private channel by @MalayalamTrollVoice"
async with client.takeout(finalize=True) as takeout:
a = await takeout(functions.channels.GetLeftChannelsRequest(offset=0))
for c in a.chats:
if channel_name in c.title:
print((await takeout(functions.messages.ExportChatInviteRequest(peer=c))).link)
break
ℹ @UniBorg
UniBorg
😁 Sticker
If SpEcHiDe/UniBorg is getting banned by Heroku,
you can try deploying by cliicking here.
👉 Please reply to this message, if it is working for you ❗
E️DIT: apparently, app still getting suspended 😂😂
you can try deploying by cliicking here.
👉 Please reply to this message, if it is working for you ❗
E️DIT: apparently, app still getting suspended 😂😂
EVAL:
OUTPUT:
[p(f"{two.emoticon} : https://t.me/addtheme/{two.theme.slug}") for two in (await client(functions.account.GetChatThemesRequest(hash=0))).themes]
OUTPUT:
'🦁 : https://t.me/addtheme/TzmDSfZB3Jpo8rPa'
'⛄ : https://t.me/addtheme/OneKsXbxszAviWox'
'💎 : https://t.me/addtheme/EfmGihKfksqPNM0s'
'👨\u200d🏫 : https://t.me/addtheme/m0GO25WGgAGWTK4L'
'🌷 : https://t.me/addtheme/UW1iFxAfcVnthTGD'
'🔮 : https://t.me/addtheme/tCVDhTa6f6TL5RCo'
'🎄 : https://t.me/addtheme/gC1Vqv8HCqr7YBl4'
'🎮 : https://t.me/addtheme/asq5HjXic5xIUzeN'