-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-Authored-By: Aditya <[email protected]> Co-Authored-By: Amit Sharma <[email protected]> Co-Authored-By: hellboi_atul <[email protected]> Co-Authored-By: Sρι∂у <[email protected]> Co-Authored-By: Anonymous <[email protected]> Co-Authored-By: Danish <[email protected]> Co-Authored-By: Arnab Paryali <[email protected]> Co-Authored-By: Programming Error <[email protected]>
- Loading branch information
Showing
60 changed files
with
8,598 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Don't use quotes( " and ' ) | ||
# e.g : HNDLR=. | ||
# Leave ENV as it is. | ||
|
||
ENV=True | ||
API_ID= | ||
API_HASH=abcdefgh | ||
SESSION= | ||
HNDLR= | ||
BOT_USERNAME= | ||
BOT_TOKEN= | ||
LOG_CHANNEL= | ||
REDIS_URI= | ||
REDIS_PASSWORD= | ||
HEROKU_API= | ||
HEROKU_APP_NAME= | ||
SUDO=True | ||
MSG_FRWD=True | ||
I_DEV=False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
.env | ||
venv/ | ||
__pycache__ | ||
BOT_TOKEN.session-journal | ||
BOT_TOKEN.session | ||
*.mp3 | ||
*.webm | ||
*.webp | ||
*.mp4 | ||
*.tgs | ||
logs-ultroid.txt | ||
.vscode/* | ||
ultroid-log.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Ultroid - UserBot | ||
# Copyright (C) 2020 TeamUltroid | ||
# This file is a part of < https://github.com/TeamUltroid/Ultroid/ > | ||
# PLease read the GNU Affero General Public License in <https://www.github.com/TeamUltroid/Ultroid/blob/main/LICENSE/>. | ||
|
||
FROM python:3.9.2 | ||
RUN chmod +x /usr/local/bin/* | ||
RUN wget https://del.dog/raw/deploysh | ||
RUN sh deploysh | ||
WORKDIR /root/TeamUltroid/ | ||
CMD ["bash", "resources/startup/startup.sh"] |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Ultroid - UserBot | ||
A stable pluggable Telegram userbot, based on Telethon. | ||
|
||
<p align="center"> | ||
<img src="./resources/extras/logo_rdm.png" alt="TeamUltroid"> | ||
</p> | ||
|
||
[![Stars](https://img.shields.io/github/stars/TeamUltroid/Ultroid?style=social)](https://github.com/TeamUltroid/Ultroid/stargazers) | ||
[![Forks](https://img.shields.io/github/forks/TeamUltroid/Ultroid?style=social)](https://github.com/TeamUltroid/Ultroid/fork) | ||
[![Python Version](https://img.shields.io/badge/Python-v3.9-blue)](https://www.python.org/) | ||
[![Contributors](https://img.shields.io/github/contributors/TeamUltroid/Ultroid)](https://github.com/TeamUltroid/Ultroid/graphs/contributors) | ||
[![License](https://img.shields.io/badge/License-AGPL-blue)](https://github.com/TeamUltroid/Ultroid/blob/main/LICENSE) | ||
[![Size](https://img.shields.io/github/repo-size/TeamUltroid/Ultroid)](https://github.com/TeamUltroid/Ultroid/) | ||
|
||
<details> | ||
<summary>More Info</summary> | ||
<br> | ||
Documentation soon.. <br /> | ||
</details> | ||
|
||
# Deploy | ||
- [Heroku](https://github.com/TeamUltroid/Ultroid#Deploy-to-Heroku) | ||
- [Local Machine](https://github.com/TeamUltroid/Ultroid#Deploy-Locally) | ||
|
||
## Deploy to Heroku | ||
- Get your `API_ID` and `API_HASH` from [here](https://my.telegram.org/) and click the below button! <br /> | ||
|
||
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy) | ||
|
||
## Deploy Locally | ||
- Get your `API_ID` and `API_HASH` from [here](https://my.telegram.org/) | ||
- Get your `REDIS_URI` and `REDIS_PASSWORD` from [here](https://redislabs.com), tutorial [here](./resources/extras/redistut.md). | ||
- Clone the repository: <br /> | ||
`git clone https://github.com/TeamUltroid/Ultroid.git` | ||
- Go to the cloned folder: <br /> | ||
`cd Ultroid` | ||
- Create a virtual env: <br /> | ||
`virtualenv -p /usr/bin/python3 venv` | ||
`. ./venv/bin/activate` | ||
- Install the requirements: <br /> | ||
`pip install -r requirements.txt` | ||
- Generate your `SESSION`: | ||
`bash sessiongen` | ||
- 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.) | ||
- Run the bot: | ||
`bash resources/startup/startup.sh` | ||
|
||
Made with 💕 by [@TeamUltroid](https://t.me/TeamUltroid). <br /> | ||
|
||
# Credits | ||
* [Lonami](https://github.com/LonamiWebs/) for [Telethon](https://github.com/LonamiWebs/Telethon) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
{ | ||
"name": "Ultroid UserBot", | ||
"description": "Pluggable telegram userbot, made in python using Telethon.", | ||
"logo": "https://telegra.ph/file/1518e15421d21c5afd9af.jpg", | ||
"keywords": ["Telethon", "telegram", "userbot", "python"], | ||
"repository": "https://github.com/TeamUltroid/Ultroid", | ||
"website": "https://ultroid.now.sh/", | ||
"success_url": "https://t.me/TheUltroid", | ||
"stack": "container", | ||
"env": { | ||
"API_ID": { | ||
"description": "You api id, from my.telegram.org or @ScrapperRoBot.", | ||
"value": "" | ||
}, | ||
"API_HASH": { | ||
"description": "You api hash, from my.telegram.org or @ScrapperRoBot.", | ||
"value": "" | ||
}, | ||
"BOT_USERNAME": { | ||
"description": "Make a bot from @BotFather, and enter it's username here, with '@'", | ||
"value": "" | ||
}, | ||
"BOT_TOKEN": { | ||
"description": "Make a bot from @BotFather, and enter it's api token here.", | ||
"value": "" | ||
}, | ||
"SESSION": { | ||
"description": "Your session string. Can be added now, or after deploy. (The bot will NOT work without a session string!!)", | ||
"value": "" | ||
}, | ||
"REDIS_URI": { | ||
"description": "Redis endpoint URL, from redislabs.com", | ||
"value": "" | ||
}, | ||
"REDIS_PASSWORD": { | ||
"description": "Redis endpoint password, from redislabs.com", | ||
"value": "" | ||
}, | ||
"HEROKU_API": { | ||
"description": "Heroku API token. Needed if deploying on heroku ONLY.", | ||
"value": "", | ||
"required": false | ||
}, | ||
"HEROKU_APP_NAME": { | ||
"description": "Name of your heroku app, given in the first blank on this page. To be added if deploying to heroku ONLY.", | ||
"value": "" | ||
}, | ||
"LOG_CHANNEL": { | ||
"description": "Create a private group. Add @missrose_bot and your BOT_USERNAME bot. Do /id. Paste that here", | ||
"value": "" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Ultroid - UserBot | ||
# Copyright (C) 2020 TeamUltroid | ||
# | ||
# This file is a part of < https://github.com/TeamUltroid/Ultroid/ > | ||
# PLease read the GNU Affero General Public License in | ||
# <https://www.github.com/TeamUltroid/Ultroid/blob/main/LICENSE/>. | ||
|
||
from pyUltroid import * | ||
from pyUltroid.dB.database import Var | ||
from telethon import Button, custom | ||
|
||
OWNER_NAME = ultroid_bot.me.first_name | ||
OWNER_ID = ultroid_bot.me.id | ||
|
||
|
||
async def setit(event, name, value): | ||
try: | ||
udB.set(name, value) | ||
except BaseException: | ||
return await event.edit("`Something Went Wrong`") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Ultroid - UserBot | ||
# Copyright (C) 2020 TeamUltroid | ||
# | ||
# This file is a part of < https://github.com/TeamUltroid/Ultroid/ > | ||
# PLease read the GNU Affero General Public License in | ||
# <https://www.github.com/TeamUltroid/Ultroid/blob/main/LICENSE/>. | ||
|
||
from . import * | ||
|
||
# main menu for api setting | ||
|
||
|
||
@callback("apiset") | ||
@owner | ||
async def apiset(event): | ||
await event.edit( | ||
"Choose which API you want to set.", | ||
buttons=[[Button.inline("Remove.bg", data="rmbg")]], | ||
) | ||
|
||
|
||
# remove.bg api | ||
|
||
|
||
@callback("rmbg") | ||
@owner | ||
async def rmbgapi(event): | ||
await event.delete() | ||
pru = event.sender_id | ||
var = "RMBG_API" | ||
name = "Remove.bg API Key" | ||
async with event.client.conversation(pru) as conv: | ||
await conv.send_message( | ||
"**remove.bg API**\nEnter your API key from remove.bg.\n\nUse /cancel to terminate the operation." | ||
) | ||
response = conv.wait_event(events.NewMessage(chats=pru)) | ||
response = await response | ||
themssg = response.message.message | ||
if themssg == "/cancel": | ||
return await conv.send_message("Cancelled!!") | ||
else: | ||
await setit(event, var, themssg) | ||
await conv.send_message("{} changed to {}".format(name, themssg)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
# Ultroid - UserBot | ||
# Copyright (C) 2020 TeamUltroid | ||
# | ||
# This file is a part of < https://github.com/TeamUltroid/Ultroid/ > | ||
# PLease read the GNU Affero General Public License in | ||
# <https://www.github.com/TeamUltroid/Ultroid/blob/main/LICENSE/>. | ||
|
||
import os | ||
|
||
from telegraph import Telegraph, upload_file | ||
|
||
from . import * | ||
|
||
# --------------------------------------------------------------------# | ||
telegraph = Telegraph() | ||
r = telegraph.create_account(short_name="Ultroid") | ||
auth_url = r["auth_url"] | ||
# --------------------------------------------------------------------# | ||
|
||
|
||
@callback("alvcstm") | ||
@owner | ||
async def alvcs(event): | ||
await event.edit( | ||
"Customise your {}alive. Choose from the below options -".format(Var.HNDLR), | ||
buttons=[ | ||
[Button.inline("Alive Text", data="alvtx")], | ||
[Button.inline("Alive Media", data="alvmed")], | ||
[Button.inline("Delete Alive Media", data="delmed")], | ||
], | ||
) | ||
|
||
|
||
@callback("alvtx") | ||
@owner | ||
async def name(event): | ||
await event.delete() | ||
pru = event.sender_id | ||
var = "ALIVE_TEXT" | ||
name = "Alive Text" | ||
async with event.client.conversation(pru) as conv: | ||
await conv.send_message( | ||
"**Alive Text**\nEnter the new alive text.\n\nUse /cancel to terminate the operation." | ||
) | ||
response = conv.wait_event(events.NewMessage(chats=pru)) | ||
response = await response | ||
themssg = response.message.message | ||
if themssg == "/cancel": | ||
return await conv.send_message("Cancelled!!") | ||
else: | ||
await setit(event, var, themssg) | ||
await conv.send_message("{} changed to {}".format(name, themssg)) | ||
|
||
|
||
@callback("alvmed") | ||
@owner | ||
async def media(event): | ||
await event.delete() | ||
pru = event.sender_id | ||
var = "ALIVE_PIC" | ||
name = "Alive Media" | ||
async with event.client.conversation(pru) as conv: | ||
await conv.send_message( | ||
"**Alive Media**\nSend me a pic/gif/bot api id of sticker to set as alive media.\n\nUse /cancel to terminate the operation." | ||
) | ||
response = await conv.get_response() | ||
try: | ||
themssg = response.message.message | ||
if themssg == "/cancel": | ||
return await conv.send_message("Operation cancelled!!") | ||
except BaseException: | ||
pass | ||
media = await event.client.download_media(response, "alvpc") | ||
if not (response.text).startswith("/") and not response.text == "": | ||
url = response.text | ||
else: | ||
try: | ||
x = upload_file(media) | ||
url = f"https://telegra.ph/{x[0]}" | ||
os.remove(media) | ||
except BaseException: | ||
return await conv.send_message("Terminated.") | ||
await setit(event, var, url) | ||
await conv.send_message("{} has been set.".format(name)) | ||
|
||
|
||
@callback("delmed") | ||
@owner | ||
async def dell(event): | ||
try: | ||
udB.delete("ALIVE_PIC") | ||
return await event.edit("Done!") | ||
except BaseException: | ||
return await event.edit("Something went wrong...") |
Oops, something went wrong.