Skip to content

Commit

Permalink
Merge pull request #10 from RachelSaini/main
Browse files Browse the repository at this point in the history
update FSUB
  • Loading branch information
oVo-HxBots authored Sep 7, 2022
2 parents 499bfb7 + 37a9584 commit 031fe99
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 47 deletions.
74 changes: 37 additions & 37 deletions multiupload/plugins/anonfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,51 +12,51 @@

@anjana.on(events.NewMessage(pattern='^/anonfile'))
async def anonfile(event):
user_id = event.sender_id
if event.is_private and not await check_participant(user_id, f'@{os.environ.get("CHNAME")}', event):
return
if event.reply_to_msg_id:
pass
else:
return await event.edit("Please Reply to File")

async with anjana.action(event.chat_id, 'typing'):
await asyncio.sleep(2)
msg = await event.reply("**Processing...**")
amjana = await event.get_reply_message()

## LOGGING TO A CHANNEL
xx = await event.get_chat()
reqmsg = f'''Req User: [{xx.first_name}](tg://user?id={xx.id})
user_id = event.sender_id
if event.is_private and not await check_participant(user_id, f'@{Config.CHNAME}', event):
return
if event.reply_to_msg_id:
pass
else:
return await event.edit("Please Reply to File")

async with anjana.action(event.chat_id, 'typing'):
await asyncio.sleep(2)
msg = await event.reply("**Processing...**")
amjana = await event.get_reply_message()

## LOGGING TO A CHANNEL
xx = await event.get_chat()
reqmsg = f'''Req User: [{xx.first_name}](tg://user?id={xx.id})
FileName: {amjana.file.name}
FileSize: {humanbytes(amjana.file.size)}
#ANONFILE'''
await anjana.send_message(Config.LOG_CHANNEL, reqmsg)
await anjana.send_message(Config.LOG_CHANNEL, reqmsg)

## Uploading
result = await downloader(
f"downloads/{amjana.file.name}",
amjana.media.document,
msg,
time.time(),
f"**🏷 Downloading...**\n➲ **File Name:** {amjana.file.name}",
)

async with anjana.action(event.chat_id, 'document'):
await msg.edit("Now Uploading to Anonfile")
url = "https://api.anonfiles.com/upload"
r = post(url, files={'file': open(f'{result.name}','rb')})
await anjana.action(event.chat_id, 'cancel')

hmm = f'''File Uploaded successfully !!
result = await downloader(
f"downloads/{amjana.file.name}",
amjana.media.document,
msg,
time.time(),
f"**🏷 Downloading...**\n➲ **File Name:** {amjana.file.name}",
)

async with anjana.action(event.chat_id, 'document'):
await msg.edit("Now Uploading to Anonfile")
url = "https://api.anonfiles.com/upload"
r = post(url, files={'file': open(f'{result.name}','rb')})
await anjana.action(event.chat_id, 'cancel')

hmm = f'''File Uploaded successfully !!
Server: AnonFile
**~ File name:** __{amjana.file.name}__
**~ File size:** __{humanbytes(amjana.file.size)}__
NOTE: Cant find notes. Its also anonymous 🤕'''
await msg.edit(hmm, buttons=(
[Button.url('📦 Download', r.json()["data"]["file"]["url"]["short"])],
[Button.url('Support Chat 💭', 't.me/hxsupport')]
))
await msg.edit(hmm, buttons=(
[Button.url('📦 Download', r.json()["data"]["file"]["url"]["short"])],
[Button.url('Support Chat 💭', 't.me/hxsupport')]
))

os.remove(result.name)
os.remove(result.name)
2 changes: 1 addition & 1 deletion multiupload/plugins/bayfiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
@anjana.on(events.NewMessage(pattern='^/bayfiles'))
async def bayfiles(event):
user_id = event.sender_id
if event.is_private and not await check_participant(user_id, f'@{os.environ.get("CHNAME")}', event):
if event.is_private and not await check_participant(user_id, f'@{Config.CHNAME}', event):
return
if not event.reply_to_msg_id:
return await event.edit("Please Reply to File")
Expand Down
2 changes: 1 addition & 1 deletion multiupload/plugins/etc.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ async def start(event):
await asyncio.sleep(3)
user_id = event.sender_id
xx = await event.get_chat()
if event.is_private and not await check_participant(user_id, f'@{os.environ.get("CHNAME")}', event):
if event.is_private and not await check_participant(user_id, f'@{Config.CHNAME}', event):
return
else:
await anjana.send_file(event.chat_id, random.choice(s), reply_to=event)
Expand Down
4 changes: 2 additions & 2 deletions multiupload/plugins/fileio.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# (c) oVoIndia | oVo-HxBots
# (c) oVoIndia | oVo-HxBots | RachelSaini

import asyncio, os, requests, time
from requests import post
Expand All @@ -13,7 +13,7 @@
@anjana.on(events.NewMessage(pattern='^/fileio'))
async def fileio(event):
user_id = event.sender_id
if event.is_private and not await check_participant(user_id, f'@{os.environ.get("CHNAME")}', event):
if event.is_private and not await check_participant(user_id, f'@{Config.CHNAME}', event):
return
if event.reply_to_msg_id:
pass
Expand Down
2 changes: 1 addition & 1 deletion multiupload/plugins/gofile.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
@anjana.on(events.NewMessage(pattern='^/gofile'))
async def gofile(event):
user_id = event.sender_id
if event.is_private and not await check_participant(user_id, f'@{os.environ.get("CHNAME")}', event):
if event.is_private and not await check_participant(user_id, f'@{Config.CHNAME}', event):
return
if event.reply_to_msg_id:
pass
Expand Down
2 changes: 1 addition & 1 deletion multiupload/plugins/mixdrop.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
@anjana.on(events.NewMessage(pattern='^/mixdrop'))
async def mixdrop(event):
user_id = event.sender_id
if event.is_private and not await check_participant(user_id, f'@{os.environ.get("CHNAME")}', event):
if event.is_private and not await check_participant(user_id, f'@{Config.CHNAME}', event):
return
if event.reply_to_msg_id:
pass
Expand Down
2 changes: 1 addition & 1 deletion multiupload/plugins/tninja.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
@anjana.on(events.NewMessage(pattern='^/tninja'))
async def tninja(event):
user_id = event.sender_id
if event.is_private and not await check_participant(user_id, f'@{os.environ.get("CHNAME")}', event):
if event.is_private and not await check_participant(user_id, f'@{Config.CHNAME}', event):
return
if event.reply_to_msg_id:
pass
Expand Down
2 changes: 1 addition & 1 deletion multiupload/plugins/tsh.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
@anjana.on(events.NewMessage(pattern='^/tsh'))
async def transfer(event):
user_id = event.sender_id
if event.is_private and not await check_participant(user_id, f'@{os.environ.get("CHNAME")}', event):
if event.is_private and not await check_participant(user_id, f'@{Config.CHNAME}', event):
return
if event.reply_to_msg_id:
pass
Expand Down
4 changes: 2 additions & 2 deletions multiupload/plugins/ufile.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# (c) oVoIndia | oVo-HxBots
# (c) oVoIndia | oVo-HxBots | RachelSaini

import asyncio, os, requests, time
from requests import post
Expand All @@ -13,7 +13,7 @@
@anjana.on(events.NewMessage(pattern='^/ufile'))
async def ufile(event):
user_id = event.sender_id
if event.is_private and not await check_participant(user_id, f'@{os.environ.get("CHNAME")}', event):
if event.is_private and not await check_participant(user_id, f'@{Config.CHNAME}', event):
return
if event.reply_to_msg_id:
pass
Expand Down

0 comments on commit 031fe99

Please sign in to comment.