Skip to content

Commit

Permalink
v0.0.9 18/07/2021
Browse files Browse the repository at this point in the history
Co-authored-by: New-dev0 <[email protected]>
Co-authored-by: Aditya <[email protected]>
Co-authored-by: Amit Sharma <[email protected]>
Co-authored-by: sppidy <[email protected]>
Co-authored-by: Arnab Paryali <[email protected]>
Co-authored-by: divkix <[email protected]>
Co-authored-by: hellboi_atul <[email protected]>
Co-authored-by: Programming Error <[email protected]>
  • Loading branch information
9 people committed Jul 18, 2021
1 parent 71fddc8 commit 386eff6
Show file tree
Hide file tree
Showing 140 changed files with 3,333 additions and 3,038 deletions.
2 changes: 1 addition & 1 deletion .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ API_ID=
API_HASH=
SESSION=
REDIS_URI=
REDIS_PASSWORD=
REDIS_PASSWORD=
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ contact_links:
about: Please drop your doubts or queries there for an immediate response.
- name: Documentation
url: https://ultroid.tech/
about: Basic documentation for setting up.
about: Basic documentation for setting up.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ node_modules/
glitch_me/
.idea/
.vscode/
temp/
temp/
4 changes: 1 addition & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,4 @@ WORKDIR /root/TeamUltroid/

RUN pip3 install --no-cache-dir -r requirements.txt

RUN npm install -g [email protected] -g
RUN npm install
RUN npm run build
CMD ["bash", "resources/startup/startup.sh"]
24 changes: 0 additions & 24 deletions Makefile

This file was deleted.

20 changes: 11 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
[![Open Source Love svg2](https://badges.frapsoft.com/os/v2/open-source.svg?v=103)](https://github.com/TeamUltroid/Ultroid)
[![Contributors](https://img.shields.io/github/contributors/TeamUltroid/Ultroid?style=flat-square&color=green)](https://github.com/TeamUltroid/Ultroid/graphs/contributors)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://makeapullrequest.com)
[![License](https://img.shields.io/badge/License-AGPL-blue)](https://github.com/TeamUltroid/Ultroid/blob/main/LICENSE)
[![License](https://img.shields.io/badge/License-AGPL-blue)](https://github.com/TeamUltroid/Ultroid/blob/main/LICENSE)
[![Sparkline](https://stars.medv.io/Teamultroid/Ultroid.svg)](https://stars.medv.io/TeamUltroid/Ultroid)

----
Expand All @@ -37,16 +37,16 @@
## Deploy to Heroku
Get the [Necessary Variables](#Necessary-Variables) and then click the button below!

[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://dashboard.heroku.com/new?template=https%3A%2F%2Fgithub.com%2F1Danish-00%2FUltroid-1)
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://dashboard.heroku.com/new?template=https%3A%2F%2Fgithub.com%2F1Danish-00%2FSideLoad)

## Deploy Locally
- [Traditional Method](#local-deploy---traditional-method)
- [Easy Method](#local-deploy---easy-method)

### Local Deploy - Easy Method
- Linux - `bash -c "$(curl -fsSL https://git.io/JY9UM)"`
- Windows - `cd desktop ; wget https://del.dog/raw/ultroid-termux -o locals.py ; python locals.py`
- Termux - `sh -c "$(curl -fsSL https://del.dog/raw/ultroid-termux-deploy)"`
- Windows - `cd desktop ; wget https://git.io/JY9UM -o locals.py ; python locals.py`
- Termux - `sh -c "$(curl -fsSL https://git.io/JY9UM)"`

### Local Deploy - Traditional Method
- Get your [Necessary Variables](#Necessary-Variables)
Expand All @@ -63,11 +63,11 @@ Get the [Necessary Variables](#Necessary-Variables) and then click the button be
- For Linux users:
`bash sessiongen`
or
`bash -c "$(curl -fsSL https://del.dog/ultroid)"`
`bash -c "$(curl -fsSL https://git.io/JY9JI)"`
- For Termux users:
`sh -c "$(curl -fsSL https://da.gd/termux-tel)"`
`sh -c "$(curl -fsSL https://git.io/JqgsR)"`
- For Windows Users:
`cd desktop ; wget https://del.dog/ultroid -o ultroid.py ; python ultroid.py`
`cd desktop ; wget https://git.io/JY9JI -o ultroid.py ; python ultroid.py`
- Fill your details in a `.env` file, as given in [`.env.sample`](https://github.com/TeamUltroid/Ultroid/blob/main/.env.sample).
(You can either edit and rename the file or make a new file named `.env`.)
- Run the bot:
Expand All @@ -86,9 +86,10 @@ Get the [Necessary Variables](#Necessary-Variables) and then click the button be
## Session String
Different ways to get your `SESSION`:
* [![Run on Repl.it](https://replit.com/badge/github/TeamUltroid/Ultroid)](https://replit.com/@TeamUltroid/UltroidStringSession)
* Linux : `bash -c "$(curl -fsSL https://del.dog/ultroid)"`
* Linux : `bash -c "$(curl -fsSL https://git.io/JY9JI)"`
* PowerShell : `cd desktop ; wget https://git.io/JY9JI ; python ultroid.py`
* Termux : `sh -c "$(curl -fsSL https://da.gd/termux-tel)"`
* TelegramBot : [@SessionGeneratorBot](https://t.me/SessionGeneratorBot)

Made with 💕 by [@TeamUltroid](https://t.me/TeamUltroid). <br />

Expand All @@ -100,5 +101,6 @@ Ultroid is licensed under [GNU Affero General Public License](https://www.gnu.or
# Credits
* [![TeamUltroid-Devs](https://img.shields.io/static/v1?label=Teamultroid&message=devs&color=critical)](https://t.me/UltroidDevs)
* [Lonami](https://github.com/LonamiWebs/) for [Telethon.](https://github.com/LonamiWebs/Telethon)
* [AndrewLaneX](https://github.com/AndrewLaneX) for [tgcalls-base.](http://github.com/tgcallsjs/tgcalls)
* [Dan](https://github.com/delivrance) for [Pyrogram.](https://github.com/pyrogram/pyrogram)
* [Pytgcalls](https://github.com/pytgcalls) for [PyTgCalls.](https://github.com/pytgcalls/pytgcalls)

100 changes: 81 additions & 19 deletions assistant/othervars.py → assistant/callbackstuffs.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
# <https://www.github.com/TeamUltroid/Ultroid/blob/main/LICENSE/>.

import re
import urllib
from glob import glob
from os import remove
from random import choices

import requests
from telegraph import Telegraph
from telegraph import upload_file as upl

Expand All @@ -27,7 +27,33 @@


@callback(
re.compile("sndplug_(.*)"),
re.compile(
"ebk_(.*)",
),
)
async def eupload(event):
match = event.pattern_match.group(1).decode("utf-8")
await event.answer("Uploading..")
try:
await event.edit(
file=f"https://www.gutenberg.org/files/{match}/{match}-pdf.pdf"
)
except BaseException:
book = "Ultroid-Book.epub"
urllib.request.urlretrieve(
"https://www.gutenberg.org/ebooks/132.epub.images", book
)
fn, media, _ = await asst._file_to_media(
book, thumb="resources/extras/ultroid.jpg"
)
await event.edit(file=media)
remove(book)


@callback(
re.compile(
"sndplug_(.*)",
),
)
async def send(eve):
name = (eve.data_match.group(1)).decode("UTF-8")
Expand Down Expand Up @@ -133,9 +159,9 @@ async def changes(okk):
changelog_str = changelog + f"\n\nClick the below button to update!"
if len(changelog_str) > 1024:
await okk.edit(get_string("upd_4"))
file = open(f"ultroid_updates.txt", "w+")
file.write(tl_chnglog)
file.close()
await asyncio.sleep(2)
with open(f"ultroid_updates.txt", "w+") as file:
file.write(tl_chnglog)
await okk.edit(
get_string("upd_5"),
file="ultroid_updates.txt",
Expand All @@ -159,15 +185,14 @@ async def changes(okk):
@owner
async def _(e):
ok = (e.data_match.group(1)).decode("UTF-8")
hmm = open(ok)
hmmm = hmm.read()
hmm.close()
key = (
requests.post("https://nekobin.com/api/documents", json={"content": hmmm})
.json()
.get("result")
.get("key")
)
with open(ok, "r") as hmm:
_, key = get_paste(hmm.read())
if _ == "dog":
link = "https://del.dog/" + key
raw = "https://del.dog/raw/" + key
else:
link = "https://nekobin.com/" + key
raw = "https://nekobin.com/raw/" + key
if ok.startswith("plugins"):
buttons = [
Button.inline("« Bᴀᴄᴋ", data="back"),
Expand All @@ -179,9 +204,10 @@ async def _(e):
Button.inline("••Cʟᴏꜱᴇ••", data="close"),
]
await e.edit(
f"Pasted to Nekobin\n 👉[Link](https://nekobin.com/{key})\n 👉[Raw Link](https://nekobin.com/raw/{key})",
f"<strong>Pasted\n 👉<a href={link}>[Link]</a>\n 👉<a href={raw}>[Raw Link]</a></strong>",
buttons=buttons,
link_preview=False,
parse_mode="html",
)


Expand Down Expand Up @@ -220,7 +246,7 @@ async def _(e):
+ "4. Copy link of that folder.\n"
+ "5. Send all characters which is after id= .",
)
async with ultroid_bot.asst.conversation(e.sender_id) as conv:
async with asst.conversation(e.sender_id) as conv:
reply = conv.wait_event(events.NewMessage(from_users=e.sender_id))
repl = await reply
udB.set("GDRIVE_FOLDER_ID", repl.text)
Expand All @@ -236,7 +262,7 @@ async def _(e):
if not e.is_private:
return
await e.edit("Send your CLIENT SECRET")
async with ultroid_bot.asst.conversation(e.sender_id) as conv:
async with asst.conversation(e.sender_id) as conv:
reply = conv.wait_event(events.NewMessage(from_users=e.sender_id))
repl = await reply
udB.set("GDRIVE_CLIENT_SECRET", repl.text)
Expand All @@ -252,7 +278,7 @@ async def _(e):
if not e.is_private:
return
await e.edit("Send your CLIENT ID ending with .com")
async with ultroid_bot.asst.conversation(e.sender_id) as conv:
async with asst.conversation(e.sender_id) as conv:
reply = conv.wait_event(events.NewMessage(from_users=e.sender_id))
repl = await reply
if not repl.text.endswith(".com"):
Expand Down Expand Up @@ -720,11 +746,47 @@ async def alvcs(event):
Button.inline("Sᴇᴛ Wᴀʀɴs", data="swarn"),
Button.inline("Dᴇʟᴇᴛᴇ Pᴍ Mᴇᴅɪᴀ", data="delpmmed"),
],
[Button.inline("PMPermit Type", data="pmtype")],
[Button.inline("« Bᴀᴄᴋ", data="ppmset")],
],
)


@callback("pmtype")
@owner
async def pmtyp(e):
await event.edit(
"Select the type of PMPermit needed.",
buttons=[
[Button.inline("Inline", data="inpm_in")],
[Button.inline("Normal", data="inpm_no")],
[Button.inline("« Bᴀᴄᴋ", data="pmcstm")],
],
)


@callback("inpm_in")
@owner
async def inl_on(event):
var = "INLINE_PM"
await setit(event, var, "True")
await event.edit(
f"Done!! PMPermit type has been set to inline!",
buttons=[[Button.inline("« Bᴀᴄᴋ", data="pmtype")]],
)


@callback("inpm_no")
@owner
async def inl_on(event):
var = "INLINE_PM"
await setit(event, var, "False")
await event.edit(
f"Done!! PMPermit type has been set to normal!",
buttons=[[Button.inline("« Bᴀᴄᴋ", data="pmtype")]],
)


@callback("pmtxt")
@owner
async def name(event):
Expand Down Expand Up @@ -988,7 +1050,7 @@ async def name(event):
name = "Bot Welcome Message:"
async with event.client.conversation(pru) as conv:
await conv.send_message(
"**BOT WELCOME MSG**\nEnter the msg which u want to show when someone start your assistant Bot.\n\nUse /cancel to terminate the operation.",
"**BOT WELCOME MSG**\nEnter the msg which u want to show when someone start your assistant Bot.\nYou Can use `{me}` , `{mention}` Parameters Too\nUse /cancel to terminate the operation.",
)
response = conv.wait_event(events.NewMessage(chats=pru))
response = await response
Expand Down
Loading

0 comments on commit 386eff6

Please sign in to comment.