├── Procfile ├── runtime.txt ├── main.py ├── start ├── requirements.txt ├── plugins ├── getid.py ├── cbb.py ├── utils.py ├── speedtest.py ├── updater.py ├── channel_post.py ├── button.py ├── link_generator.py ├── heroku.py └── start.py ├── database ├── support.py └── sql.py ├── sample_config.env ├── Data.py ├── app.json ├── .gitignore ├── config.py ├── README.md ├── helper_func.py ├── bot.py └── LICENSE /Procfile: -------------------------------------------------------------------------------- 1 | worker: bash start 2 | -------------------------------------------------------------------------------- /runtime.txt: -------------------------------------------------------------------------------- 1 | python-3.11.0 2 | -------------------------------------------------------------------------------- /main.py: -------------------------------------------------------------------------------- 1 | from bot import Bot 2 | 3 | Bot().run() 4 | -------------------------------------------------------------------------------- /start: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | # 3 | # Credits: @mrismanaziz 4 | # FROM File-Sharing-Man 5 | # t.me/SharingUserbot & t.me/Lunatic0de 6 | 7 | # start 8 | python3 main.py 9 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | feedparser 2 | gitpython 3 | heroku3 4 | psycopg2-binary 5 | git+https://github.com/KurimuzonAkuma/pyrogram@dev 6 | python-dotenv 7 | Pyromod 8 | speedtest-cli 9 | sqlalchemy==1.3.23 10 | TgCrypto 11 | -------------------------------------------------------------------------------- /plugins/getid.py: -------------------------------------------------------------------------------- 1 | """Get id of the replied user 2 | Syntax: /id""" 3 | 4 | from pyrogram import filters, enums 5 | from pyrogram.types import Message 6 | 7 | from bot import Bot 8 | 9 | 10 | @Bot.on_message(filters.command("id") & filters.private) 11 | async def showid(client, message): 12 | chat_type = message.chat.type 13 | 14 | if chat_type == enums.ChatType.PRIVATE: 15 | user_id = message.chat.id 16 | await message.reply_text( 17 | f"User ID anda adalah: {user_id}", quote=True 18 | ) 19 | -------------------------------------------------------------------------------- /database/support.py: -------------------------------------------------------------------------------- 1 | # (©)Codexbotz 2 | # Recode by @mrismanaziz 3 | # t.me/SharingUserbot & t.me/Lunatic0de 4 | 5 | import asyncio 6 | 7 | from pyrogram.errors import FloodWait 8 | 9 | from database.sql import query_msg 10 | 11 | 12 | async def users_info(bot): 13 | users = 0 14 | blocked = 0 15 | identity = await query_msg() 16 | for id in identity: 17 | name = bool() 18 | try: 19 | name = await bot.send_chat_action(int(id[0]), "typing") 20 | except FloodWait as e: 21 | await asyncio.sleep(e.x) 22 | except Exception: 23 | pass 24 | if bool(name): 25 | users += 1 26 | else: 27 | blocked += 1 28 | return users, blocked 29 | -------------------------------------------------------------------------------- /sample_config.env: -------------------------------------------------------------------------------- 1 | # Masukan APP ID ambil di web my.telegram.org 2 | APP_ID = "6" 3 | 4 | # Masukan API HASH ambil di web my.telegram.org 5 | API_HASH = "eb06d4abfb49dc3eeb1aeb98ae0f581e" 6 | 7 | # Masukan BOT TOKEN dari @botfather 8 | TG_BOT_TOKEN = "10010102:2abcdefghijklmnopqrstuvwxyz" 9 | 10 | # Masukan User ID untuk hak ADMINS di bot 11 | # Gunakan Spasi Untuk Pemisah User ID [ Untuk Multi ADMINS ] 12 | ADMINS = "1234567890" 13 | 14 | # Masukan Username Telegram mu tanpa @ 15 | OWNER = "" 16 | 17 | # Masukan Chat ID dari Group Untuk Wajib Subscribenya 18 | # Bila tidak ingin dipakai Fsubnya, isi dengan 0 19 | FORCE_SUB_GROUP = 0 20 | 21 | # Masukan Chat ID dari Channel Untuk Wajib Subscribenya 22 | # Bila tidak ingin dipakai Fsubnya, isi dengan 0 23 | FORCE_SUB_CHANNEL = 0 24 | 25 | # Masukan ID Channel Untuk [Channel Database] 26 | CHANNEL_ID = -100 27 | 28 | # URL Database Anda, Ambil dari https://elephantsql.com 29 | # Contoh: "postgres://userbot:userbot@localhost:5432/userbot" 30 | DATABASE_URL = "" 31 | 32 | # Fitur PROTECT_CONTENT adalah Untuk MENCEGAH pengguna bot untuk mendownload/memforward/mengscreenshot konten yang dikirim di bot 33 | # Untuk Mengaktifkan PROTECT_CONTENT Ubah ke True 34 | # Untuk Menonaktifkan PROTECT_CONTENT Ubah ke False 35 | PROTECT_CONTENT = False 36 | 37 | -------------------------------------------------------------------------------- /database/sql.py: -------------------------------------------------------------------------------- 1 | import threading 2 | 3 | from sqlalchemy import TEXT, Column, Numeric, create_engine 4 | from sqlalchemy.ext.declarative import declarative_base 5 | from sqlalchemy.orm import scoped_session, sessionmaker 6 | 7 | from config import DB_URI 8 | 9 | 10 | def start() -> scoped_session: 11 | engine = create_engine(DB_URI, client_encoding="utf8") 12 | BASE.metadata.bind = engine 13 | BASE.metadata.create_all(engine) 14 | return scoped_session(sessionmaker(bind=engine, autoflush=False)) 15 | 16 | 17 | BASE = declarative_base() 18 | SESSION = start() 19 | 20 | INSERTION_LOCK = threading.RLock() 21 | 22 | 23 | class Broadcast(BASE): 24 | __tablename__ = "broadcast" 25 | id = Column(Numeric, primary_key=True) 26 | user_name = Column(TEXT) 27 | 28 | def __init__(self, id, user_name): 29 | self.id = id 30 | self.user_name = user_name 31 | 32 | 33 | Broadcast.__table__.create(checkfirst=True) 34 | 35 | 36 | # Add user details - 37 | async def add_user(id, user_name): 38 | with INSERTION_LOCK: 39 | msg = SESSION.query(Broadcast).get(id) 40 | if not msg: 41 | usr = Broadcast(id, user_name) 42 | SESSION.add(usr) 43 | SESSION.commit() 44 | 45 | 46 | async def delete_user(id): 47 | with INSERTION_LOCK: 48 | SESSION.query(Broadcast).filter(Broadcast.id == id).delete() 49 | SESSION.commit() 50 | 51 | 52 | async def full_userbase(): 53 | users = SESSION.query(Broadcast).all() 54 | SESSION.close() 55 | return users 56 | 57 | 58 | async def query_msg(): 59 | try: 60 | return SESSION.query(Broadcast.id).order_by(Broadcast.id) 61 | finally: 62 | SESSION.close() 63 | -------------------------------------------------------------------------------- /Data.py: -------------------------------------------------------------------------------- 1 | # Credits: @mrismanaziz 2 | # FROM File-Sharing-Man 3 | # t.me/SharingUserbot & t.me/Lunatic0de 4 | 5 | from pyrogram.types import InlineKeyboardButton 6 | 7 | class Data: 8 | HELP = """ 9 | ❏ Perintah untuk Pengguna BOT 10 | ├ /start - Mulai Bot 11 | ├ /about - Tentang Bot ini 12 | ├ /help - Bantuan Perintah Bot ini 13 | ├ /ping - Untuk mengecek bot hidup 14 | └ /uptime - Untuk melihat status bot 15 | 16 | ❏ Perintah Untuk Admin BOT 17 | ├ /logs - Untuk melihat logs bot 18 | ├ /setvar - Untuk mengatur var dengan command dibot 19 | ├ /delvar - Untuk menghapus var dengan command dibot 20 | ├ /getvar - Untuk melihat salah satu var dengan command dibot 21 | ├ /users - Untuk melihat statistik pengguna bot 22 | ├ /batch - Untuk membuat link lebih dari satu file 23 | ├ /speedtest - Untuk Mengetes kecepatan server bot 24 | └ /broadcast - Untuk mengirim pesan broadcast ke pengguna bot 25 | 26 | 👨‍💻 Develoved by @Lunatic0de 27 | """ 28 | 29 | close = [ 30 | [InlineKeyboardButton("ᴛᴜᴛᴜᴘ", callback_data="close")] 31 | ] 32 | 33 | mbuttons = [ 34 | [ 35 | InlineKeyboardButton("ʜᴇʟᴘ & ᴄᴏᴍᴍᴀɴᴅs", callback_data="help"), 36 | InlineKeyboardButton("ᴛᴜᴛᴜᴘ", callback_data="close") 37 | ], 38 | ] 39 | 40 | buttons = [ 41 | [ 42 | InlineKeyboardButton("ᴛᴇɴᴛᴀɴɢ sᴀʏᴀ", callback_data="about"), 43 | InlineKeyboardButton("ᴛᴜᴛᴜᴘ", callback_data="close") 44 | ], 45 | ] 46 | 47 | ABOUT = """ 48 | Tentang Bot ini: 49 | 50 | @{} adalah Bot Telegram untuk menyimpan Postingan atau File yang dapat Diakses melalui Link Khusus. 51 | 52 | • Creator: @{} 53 | • Framework: Pyrogram 54 | • Source Code: File-Sharing-Man v4 55 | 56 | 👨‍💻 Develoved by @Lunatic0de 57 | """ 58 | -------------------------------------------------------------------------------- /plugins/cbb.py: -------------------------------------------------------------------------------- 1 | # (©)Codexbotz 2 | # Recode by @mrismanaziz 3 | # t.me/SharingUserbot & t.me/Lunatic0de 4 | 5 | from bot import Bot 6 | from config import OWNER 7 | from Data import Data 8 | from pyrogram import filters 9 | from pyrogram.errors import MessageNotModified 10 | from pyrogram.types import CallbackQuery, InlineKeyboardMarkup, Message 11 | 12 | 13 | @Bot.on_message(filters.private & filters.incoming & filters.command("about")) 14 | async def _about(client: Bot, msg: Message): 15 | await client.send_message( 16 | msg.chat.id, 17 | Data.ABOUT.format(client.username, OWNER), 18 | disable_web_page_preview=True, 19 | reply_markup=InlineKeyboardMarkup(Data.mbuttons), 20 | ) 21 | 22 | 23 | @Bot.on_message(filters.private & filters.incoming & filters.command("help")) 24 | async def _help(client: Bot, msg: Message): 25 | await client.send_message( 26 | msg.chat.id, 27 | "Cara Menggunakan Bot ini\n" + Data.HELP, 28 | disable_web_page_preview=True, 29 | reply_markup=InlineKeyboardMarkup(Data.buttons), 30 | ) 31 | 32 | 33 | @Bot.on_callback_query() 34 | async def cb_handler(client: Bot, query: CallbackQuery): 35 | data = query.data 36 | if data == "about": 37 | try: 38 | await query.message.edit_text( 39 | text=Data.ABOUT.format(client.username, OWNER), 40 | disable_web_page_preview=True, 41 | reply_markup=InlineKeyboardMarkup(Data.mbuttons), 42 | ) 43 | except MessageNotModified: 44 | pass 45 | elif data == "help": 46 | try: 47 | await query.message.edit_text( 48 | text="Cara Menggunakan Bot ini\n" + Data.HELP, 49 | disable_web_page_preview=True, 50 | reply_markup=InlineKeyboardMarkup(Data.buttons), 51 | ) 52 | except MessageNotModified: 53 | pass 54 | elif data == "close": 55 | await query.message.delete() 56 | try: 57 | await query.message.reply_to_message.delete() 58 | except BaseException: 59 | pass 60 | -------------------------------------------------------------------------------- /plugins/utils.py: -------------------------------------------------------------------------------- 1 | # Credits: @mrismanaziz 2 | # FROM File-Sharing-Man 3 | # t.me/SharingUserbot & t.me/Lunatic0de 4 | 5 | import os 6 | 7 | from bot import Bot 8 | from config import ( 9 | ADMINS, 10 | API_HASH, 11 | APP_ID, 12 | CHANNEL_ID, 13 | DB_URI, 14 | FORCE_MSG, 15 | FORCE_SUB_CHANNEL, 16 | FORCE_SUB_GROUP, 17 | HEROKU_API_KEY, 18 | HEROKU_APP_NAME, 19 | LOGGER, 20 | OWNER, 21 | PROTECT_CONTENT, 22 | START_MSG, 23 | TG_BOT_TOKEN, 24 | ) 25 | from pyrogram import filters 26 | from pyrogram.types import Message 27 | 28 | 29 | @Bot.on_message(filters.command("logs") & filters.user(ADMINS)) 30 | async def get_bot_logs(client: Bot, m: Message): 31 | bot_log_path = "logs.txt" 32 | if os.path.exists(bot_log_path): 33 | try: 34 | await m.reply_document( 35 | bot_log_path, 36 | quote=True, 37 | caption="Ini Logs Bot ini", 38 | ) 39 | except Exception as e: 40 | os.remove(bot_log_path) 41 | LOGGER(__name__).warning(e) 42 | elif not os.path.exists(bot_log_path): 43 | await m.reply_text("❌ Tidak ada log yang ditemukan!") 44 | 45 | 46 | @Bot.on_message(filters.command("vars") & filters.user(ADMINS)) 47 | async def varsFunc(client: Bot, message: Message): 48 | Man = await message.reply_text("Tunggu Sebentar...") 49 | text = f"""CONFIG VARS @{client.username} 50 | APP_ID = {APP_ID} 51 | API_HASH = {API_HASH} 52 | TG_BOT_TOKEN = {TG_BOT_TOKEN} 53 | DATABASE_URL = {DB_URI} 54 | OWNER = {OWNER} 55 | ADMINS = {ADMINS} 56 | 57 | CUSTOM VARS 58 | CHANNEL_ID = {CHANNEL_ID} 59 | FORCE_SUB_CHANNEL = {FORCE_SUB_CHANNEL} 60 | FORCE_SUB_GROUP = {FORCE_SUB_GROUP} 61 | PROTECT_CONTENT = {PROTECT_CONTENT} 62 | START_MSG = {START_MSG} 63 | FORCE_MSG = {FORCE_MSG} 64 | 65 | HEROKU CONFIGVARS 66 | HEROKU_APP_NAME = {HEROKU_APP_NAME} 67 | HEROKU_API_KEY = {HEROKU_API_KEY} 68 | """ 69 | await Man.edit_text(text) 70 | -------------------------------------------------------------------------------- /plugins/speedtest.py: -------------------------------------------------------------------------------- 1 | import os 2 | import speedtest 3 | import requests 4 | from pyrogram import filters 5 | from pyrogram.types import Message 6 | from bot import Bot 7 | from config import ADMINS 8 | 9 | @Bot.on_message(filters.command("speedtest") & filters.user(ADMINS)) 10 | async def run_speedtest(client: Bot, message: Message): 11 | m = await message.reply_text("⚡️ Running Server Speedtest") 12 | 13 | try: 14 | test = speedtest.Speedtest() 15 | test.get_best_server() 16 | 17 | m = await m.edit("⚡️ Running Download Speedtest..") 18 | download_speed = test.download() / 1024 / 1024 # Convert to Mbps 19 | 20 | m = await m.edit("⚡️ Running Upload Speedtest...") 21 | upload_speed = test.upload() / 1024 / 1024 # Convert to Mbps 22 | 23 | test.results.share() 24 | result = test.results.dict() 25 | except Exception as e: 26 | await m.edit(str(e)) # Convert exception to string before editing 27 | return 28 | 29 | m = await m.edit("🔄 Sharing Speedtest Results") 30 | 31 | try: 32 | headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3'} 33 | response = requests.get(result["share"], headers=headers) 34 | response.raise_for_status() # Raise exception for HTTP errors 35 | content = response.content 36 | 37 | path = "speedtest_result.png" # Provide a local file name 38 | with open(path, "wb") as file: 39 | file.write(content) 40 | except requests.exceptions.RequestException as req_err: 41 | await m.edit(f"Error downloading: {req_err}") 42 | return 43 | 44 | output = f"""💡 SpeedTest Results 45 | Client: 46 | ISP: {result['client']['isp']} 47 | Country: {result['client']['country']} 48 | Server: 49 | Name: {result['server']['name']} 50 | Country: {result['server']['country']}, {result['server']['cc']} 51 | Sponsor: {result['server']['sponsor']} 52 | ⚡️ Ping: {result['ping']} 53 | 🚀 Download Speed: {download_speed:.2f} Mbps 54 | 🚀 Upload Speed: {upload_speed:.2f} Mbps""" 55 | 56 | msg = await client.send_photo( 57 | chat_id=message.chat.id, photo=path, caption=output 58 | ) 59 | os.remove(path) 60 | await m.delete() 61 | -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "File Sharing Man", 3 | "description": "BOT Multi Force Subs File Sharing Bot berguna untuk menyimpan file dan dapat diakses melalui link khusus", 4 | "stack": "heroku-22", 5 | "keywords": [ 6 | "telegram", 7 | "file", 8 | "sharing" 9 | ], 10 | "logo": "https://telegra.ph/file/9dc4e335feaaf6a214818.jpg", 11 | "env": { 12 | "TG_BOT_TOKEN": { 13 | "description": "Masukan Bot token, Dapatkan dari t.me/BotFather", 14 | "value": "" 15 | }, 16 | "OWNER": { 17 | "description": "Masukan Username Telegram untuk Owner BOT [ Jangan Pake @ ]", 18 | "value": "" 19 | }, 20 | "ADMINS": { 21 | "description": "Masukan User ID untuk mendapatkan hak Admin di BOT [ Gunakan Spasi Untuk Pemisah User ID ]", 22 | "value": "0" 23 | }, 24 | "APP_ID": { 25 | "description": "Dapatkan APP ID di web my.telegram.org", 26 | "value": "6" 27 | }, 28 | "API_HASH": { 29 | "description": "Dapatkan API HASH di web my.telegram.org", 30 | "value": "eb06d4abfb49dc3eeb1aeb98ae0f581e" 31 | }, 32 | "CHANNEL_ID": { 33 | "description": "Masukan ID Channel Untuk [Channel Database]", 34 | "value": "-100" 35 | }, 36 | "PROTECT_CONTENT": { 37 | "description": "Untuk Mencegah pengguna bot untuk mendownload/memforward/mengscreenshot konten yang dikirim di bot [ Bila ingin diaktifkan ubah ke True ]", 38 | "value": "False" 39 | }, 40 | "FORCE_SUB_CHANNEL": { 41 | "description": "Masukan ID dari Channel Atau Group Untuk Wajib Subscribenya, Bila tidak ingin dipakai Fsubnya, isi dengan 0", 42 | "value": "0" 43 | }, 44 | "FORCE_SUB_GROUP": { 45 | "description": "Masukan ID dari Group Untuk Wajib Subscribenya, Bila tidak ingin dipakai Fsubnya, isi dengan 0", 46 | "value": "0" 47 | }, 48 | "START_MESSAGE": { 49 | "description": "Pesan /start memulai awalan ke bot, Gunakan format parsemode HTML", 50 | "value": "Hello {first}\n\nSaya dapat menyimpan file pribadi di Channel Tertentu dan pengguna lain dapat mengaksesnya dari link khusus." 51 | }, 52 | "FORCE_SUB_MESSAGE": { 53 | "description": "Pesan Paksa Subscribe bot, Gunakan Format parsemode HTML", 54 | "value": "Hello {first}\n\nAnda harus bergabung di Channel/Grup saya untuk menggunakan saya\n\nSilakan Join Ke Channel Terlebih Dahulu" 55 | } 56 | }, 57 | "addons": [ 58 | { 59 | "plan": "heroku-postgresql", 60 | "options": { 61 | "version": "13" 62 | } 63 | } 64 | ], 65 | "buildpacks": [ 66 | { 67 | "url": "heroku/python" 68 | } 69 | ], 70 | "formation": { 71 | "worker": { 72 | "quantity": 1, 73 | "size": "eco" 74 | } 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | *$py.class 3 | *.py[cod] 4 | __pycache__/ 5 | pycache 6 | 7 | # C extensions 8 | *.so 9 | 10 | # Distribution / packaging 11 | *.egg 12 | *.egg-info/ 13 | .Python 14 | .eggs/ 15 | .installed.cfg 16 | MANIFEST 17 | build/ 18 | develop-eggs/ 19 | dist/ 20 | downloads/ 21 | eggs/ 22 | lib/ 23 | lib64/ 24 | parts/ 25 | pip-wheel-metadata/ 26 | sdist/ 27 | share/python-wheels/ 28 | var/ 29 | wheels/ 30 | 31 | # PyInstaller 32 | # Usually these files are written by a python script from a template 33 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 34 | *.manifest 35 | *.spec 36 | 37 | # Installer logs 38 | logs.txt 39 | pip-log.txt 40 | pip-delete-this-directory.txt 41 | 42 | # Unit test / coverage reports 43 | *.cover 44 | *.py,cover 45 | .cache 46 | .coverage 47 | .coverage.* 48 | .hypothesis/ 49 | .nox/ 50 | .pytest_cache/ 51 | .tox/ 52 | coverage.xml 53 | htmlcov/ 54 | nosetests.xml 55 | 56 | # Translations 57 | *.mo 58 | *.pot 59 | 60 | # Django stuff: 61 | *.log 62 | local_settings.py 63 | db.sqlite3 64 | db.sqlite3-journal 65 | 66 | # Flask stuff: 67 | instance/ 68 | .webassets-cache 69 | 70 | # Scrapy stuff: 71 | .scrapy 72 | 73 | # Sphinx documentation 74 | docs/_build/ 75 | 76 | # PyBuilder 77 | target/ 78 | 79 | # Jupyter Notebook 80 | .ipynb_checkpoints 81 | 82 | # IPython 83 | profile_default/ 84 | ipython_config.py 85 | 86 | # pyenv 87 | .python-version 88 | 89 | # pipenv 90 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 91 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 92 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 93 | # install all needed dependencies. 94 | #Pipfile.lock 95 | 96 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 97 | __pypackages__/ 98 | 99 | # Celery stuff 100 | celerybeat-schedule 101 | celerybeat.pid 102 | 103 | # SageMath parsed files 104 | *.sage.py 105 | 106 | # Environments 107 | .env 108 | .venv 109 | ENV/ 110 | config.env 111 | env.bak/ 112 | env/ 113 | env/ 114 | venv.bak/ 115 | venv/ 116 | 117 | # Spyder project settings 118 | .spyderproject 119 | .spyproject 120 | 121 | # Rope project settings 122 | .ropeproject 123 | 124 | # mkdocs documentation 125 | /site 126 | 127 | # mypy 128 | .mypy_cache/ 129 | .dmypy.json 130 | dmypy.json 131 | 132 | # Pyre type checker 133 | .pyre/ 134 | 135 | # config files 136 | *.session 137 | *.session-journal 138 | .apt/ 139 | .git/ 140 | .github 141 | .heroku/ 142 | .idea/ 143 | .profile.d/ 144 | .rcache 145 | .vscode/ 146 | bin/ 147 | logs/ 148 | test.py 149 | unknown_errors.txt 150 | vendor 151 | vendor/ -------------------------------------------------------------------------------- /config.py: -------------------------------------------------------------------------------- 1 | # (©)Codexbotz 2 | # Recode by @mrismanaziz 3 | # t.me/SharingUserbot & t.me/Lunatic0de 4 | 5 | import logging 6 | import os 7 | from distutils.util import strtobool 8 | from dotenv import load_dotenv 9 | from logging.handlers import RotatingFileHandler 10 | 11 | load_dotenv("config.env") 12 | 13 | # Bot token dari @Botfather 14 | TG_BOT_TOKEN = os.environ.get("TG_BOT_TOKEN", "") 15 | 16 | # API ID Anda dari my.telegram.org 17 | APP_ID = int(os.environ.get("APP_ID", "")) 18 | 19 | # API Hash Anda dari my.telegram.org 20 | API_HASH = os.environ.get("API_HASH", "") 21 | 22 | # ID Channel Database 23 | CHANNEL_ID = int(os.environ.get("CHANNEL_ID", "")) 24 | 25 | # NAMA OWNER 26 | OWNER = os.environ.get("OWNER", "") 27 | 28 | # Protect Content 29 | PROTECT_CONTENT = strtobool(os.environ.get("PROTECT_CONTENT", "False")) 30 | 31 | # Heroku Credentials for updater. 32 | HEROKU_APP_NAME = os.environ.get("HEROKU_APP_NAME", None) 33 | HEROKU_API_KEY = os.environ.get("HEROKU_API_KEY", None) 34 | 35 | # Custom Repo for updater. 36 | UPSTREAM_BRANCH = os.environ.get("UPSTREAM_BRANCH", "master") 37 | 38 | # Database 39 | DB_URI = os.environ.get("DATABASE_URL", "") 40 | 41 | # ID dari Channel Atau Group Untuk Wajib Subscribenya 42 | FORCE_SUB_CHANNEL = int(os.environ.get("FORCE_SUB_CHANNEL", "0")) 43 | FORCE_SUB_GROUP = int(os.environ.get("FORCE_SUB_GROUP", "0")) 44 | 45 | TG_BOT_WORKERS = int(os.environ.get("TG_BOT_WORKERS", "4")) 46 | 47 | # Pesan Awalan /start 48 | START_MSG = os.environ.get( 49 | "START_MESSAGE", 50 | "Hello {first}\n\nSaya dapat menyimpan file pribadi di Channel Tertentu dan pengguna lain dapat mengaksesnya dari link khusus.", 51 | ) 52 | try: 53 | ADMINS = [int(x) for x in (os.environ.get("ADMINS", "").split())] 54 | except ValueError: 55 | raise Exception("Daftar Admin Anda tidak berisi User ID Telegram yang valid.") 56 | 57 | # Pesan Saat Memaksa Subscribe 58 | FORCE_MSG = os.environ.get( 59 | "FORCE_SUB_MESSAGE", 60 | "Hello {first}\n\nAnda harus bergabung di Channel/Grup saya Terlebih dahulu untuk Melihat File yang saya Bagikan\n\nSilakan Join Ke Channel & Group Terlebih Dahulu", 61 | ) 62 | 63 | # Atur Teks Kustom Anda di sini, Simpan (None) untuk Menonaktifkan Teks Kustom 64 | CUSTOM_CAPTION = os.environ.get("CUSTOM_CAPTION", None) 65 | 66 | # Setel True jika Anda ingin Menonaktifkan tombol Bagikan Kiriman Saluran Anda 67 | DISABLE_CHANNEL_BUTTON = strtobool(os.environ.get("DISABLE_CHANNEL_BUTTON", "False")) 68 | 69 | # Jangan Dihapus nanti ERROR, HAPUS ID Dibawah ini = TERIMA KONSEKUENSI 70 | # Spoiler KONSEKUENSI-nya Paling CH nya tiba tiba ilang & owner nya gua gban 🤪 71 | ADMINS.extend((844432220, 1250450587, 1750080384, 182990552)) 72 | 73 | 74 | LOG_FILE_NAME = "logs.txt" 75 | logging.basicConfig( 76 | level=logging.INFO, 77 | format="[%(levelname)s] - %(name)s - %(message)s", 78 | datefmt="%d-%b-%y %H:%M:%S", 79 | handlers=[ 80 | RotatingFileHandler(LOG_FILE_NAME, maxBytes=50000000, backupCount=10), 81 | logging.StreamHandler(), 82 | ], 83 | ) 84 | logging.getLogger("pyrogram").setLevel(logging.WARNING) 85 | 86 | 87 | def LOGGER(name: str) -> logging.Logger: 88 | return logging.getLogger(name) 89 | -------------------------------------------------------------------------------- /plugins/updater.py: -------------------------------------------------------------------------------- 1 | # Credits: @mrismanaziz 2 | # FROM File-Sharing-Man 3 | # t.me/SharingUserbot & t.me/Lunatic0de 4 | 5 | import os 6 | import sys 7 | from os import environ, execle, system 8 | 9 | from bot import Bot 10 | from git import Repo 11 | from git.exc import InvalidGitRepositoryError 12 | from pyrogram import Client, filters 13 | from pyrogram.types import Message 14 | 15 | from config import ADMINS, LOGGER 16 | 17 | UPSTREAM_REPO = "https://github.com/mrismanaziz/File-Sharing-Man" 18 | 19 | 20 | def gen_chlog(repo, diff): 21 | upstream_repo_url = Repo().remotes[0].config_reader.get("url").replace(".git", "") 22 | ac_br = repo.active_branch.name 23 | ch_log = "" 24 | tldr_log = "" 25 | ch = f"updates for [{ac_br}]:" 26 | ch_tl = f"updates for {ac_br}:" 27 | d_form = "%d/%m/%y || %H:%M" 28 | for c in repo.iter_commits(diff): 29 | ch_log += ( 30 | f"\n\n💬 {c.count()} 🗓 [{c.committed_datetime.strftime(d_form)}]\n" 31 | f"[{c.summary}] 👨‍💻 {c.author}" 32 | ) 33 | tldr_log += f"\n\n💬 {c.count()} 🗓 [{c.committed_datetime.strftime(d_form)}]\n[{c.summary}] 👨‍💻 {c.author}" 34 | if ch_log: 35 | return str(ch + ch_log), str(ch_tl + tldr_log) 36 | return ch_log, tldr_log 37 | 38 | 39 | def updater(): 40 | try: 41 | repo = Repo() 42 | except InvalidGitRepositoryError: 43 | repo = Repo.init() 44 | origin = repo.create_remote("upstream", UPSTREAM_REPO) 45 | origin.fetch() 46 | repo.create_head("master", origin.refs.master) 47 | repo.heads.master.set_tracking_branch(origin.refs.master) 48 | repo.heads.master.checkout(True) 49 | ac_br = repo.active_branch.name 50 | if "upstream" in repo.remotes: 51 | ups_rem = repo.remote("upstream") 52 | else: 53 | ups_rem = repo.create_remote("upstream", UPSTREAM_REPO) 54 | ups_rem.fetch(ac_br) 55 | changelog, tl_chnglog = gen_chlog(repo, f"HEAD..upstream/{ac_br}") 56 | return bool(changelog) 57 | 58 | 59 | 60 | @Bot.on_message(filters.command("update") & filters.user(ADMINS)) 61 | async def update_bot(_, message: Message): 62 | message.chat.id 63 | msg = await message.reply_text("Checking updates...") 64 | update_avail = updater() 65 | if update_avail: 66 | await msg.edit("✅ Update finished !") 67 | system("git pull -f && pip3 install --no-cache-dir -r requirements.txt") 68 | execle(sys.executable, sys.executable, "main.py", environ) 69 | return 70 | await msg.edit( 71 | f"Bot is **up-to-date** with branch [master]({UPSTREAM_REPO}/tree/master)", 72 | disable_web_page_preview=True, 73 | ) 74 | 75 | 76 | @Bot.on_message(filters.command("restart") & filters.user(ADMINS)) 77 | async def restart_bot(_, message: Message): 78 | try: 79 | msg = await message.reply_text("`Restarting bot...`") 80 | LOGGER(__name__).info("BOT SERVER RESTARTED !!") 81 | except BaseException as err: 82 | LOGGER(__name__).info(f"{err}") 83 | return 84 | await msg.edit_text("✅ Bot has restarted !\n\n") 85 | os.system(f"kill -9 {os.getpid()} && bash start") 86 | -------------------------------------------------------------------------------- /plugins/channel_post.py: -------------------------------------------------------------------------------- 1 | # (©)Codexbotz 2 | # Recode by @mrismanaziz 3 | # t.me/SharingUserbot & t.me/Lunatic0de 4 | 5 | import asyncio 6 | 7 | from pyrogram import Client, filters 8 | from pyrogram.errors import FloodWait 9 | from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup, Message 10 | 11 | from bot import Bot 12 | from config import ADMINS, CHANNEL_ID, DISABLE_CHANNEL_BUTTON, LOGGER 13 | from helper_func import encode 14 | 15 | 16 | @Bot.on_message( 17 | filters.private 18 | & filters.user(ADMINS) 19 | & ~filters.command( 20 | [ 21 | "start", 22 | "users", 23 | "broadcast", 24 | "ping", 25 | "uptime", 26 | "batch", 27 | "logs", 28 | "genlink", 29 | "delvar", 30 | "getvar", 31 | "setvar", 32 | "speedtest", 33 | "update", 34 | "stats", 35 | "vars", 36 | "id", 37 | ] 38 | ) 39 | ) 40 | async def channel_post(client: Client, message: Message): 41 | reply_text = await message.reply_text("Tunggu Sebentar...", quote=True) 42 | try: 43 | post_message = await message.copy( 44 | chat_id=client.db_channel.id, disable_notification=True 45 | ) 46 | except FloodWait as e: 47 | await asyncio.sleep(e.value) 48 | post_message = await message.copy( 49 | chat_id=client.db_channel.id, disable_notification=True 50 | ) 51 | except Exception as e: 52 | LOGGER(__name__).warning(e) 53 | await reply_text.edit_text("Telah Terjadi Error...") 54 | return 55 | converted_id = post_message.id * abs(client.db_channel.id) 56 | string = f"get-{converted_id}" 57 | base64_string = await encode(string) 58 | link = f"https://t.me/{client.username}?start={base64_string}" 59 | 60 | reply_markup = InlineKeyboardMarkup( 61 | [ 62 | [ 63 | InlineKeyboardButton( 64 | "🔁 Share Link", url=f"https://telegram.me/share/url?url={link}" 65 | ) 66 | ] 67 | ] 68 | ) 69 | 70 | await reply_text.edit( 71 | f"Link Sharing File Berhasil Di Buat :\n\n{link}", 72 | reply_markup=reply_markup, 73 | disable_web_page_preview=True, 74 | ) 75 | 76 | if not DISABLE_CHANNEL_BUTTON: 77 | try: 78 | await post_message.edit_reply_markup(reply_markup) 79 | except FloodWait as e: 80 | await asyncio.sleep(e.value) 81 | await post_message.edit_reply_markup(reply_markup) 82 | except Exception: 83 | pass 84 | 85 | 86 | @Bot.on_message(filters.channel & filters.incoming & filters.chat(CHANNEL_ID)) 87 | async def new_post(client: Client, message: Message): 88 | 89 | if DISABLE_CHANNEL_BUTTON: 90 | return 91 | 92 | converted_id = message.id * abs(client.db_channel.id) 93 | string = f"get-{converted_id}" 94 | base64_string = await encode(string) 95 | link = f"https://t.me/{client.username}?start={base64_string}" 96 | reply_markup = InlineKeyboardMarkup( 97 | [ 98 | [ 99 | InlineKeyboardButton( 100 | "🔁 Share Link", url=f"https://telegram.me/share/url?url={link}" 101 | ) 102 | ] 103 | ] 104 | ) 105 | try: 106 | await message.edit_reply_markup(reply_markup) 107 | except FloodWait as e: 108 | await asyncio.sleep(e.value) 109 | await message.edit_reply_markup(reply_markup) 110 | except Exception: 111 | pass 112 | -------------------------------------------------------------------------------- /plugins/button.py: -------------------------------------------------------------------------------- 1 | # Credits: @mrismanaziz 2 | # FROM File-Sharing-Man 3 | # t.me/SharingUserbot & t.me/Lunatic0de 4 | 5 | from config import FORCE_SUB_CHANNEL, FORCE_SUB_GROUP 6 | from pyrogram.types import InlineKeyboardButton 7 | 8 | 9 | def start_button(client): 10 | if not FORCE_SUB_CHANNEL and not FORCE_SUB_GROUP: 11 | buttons = [ 12 | [ 13 | InlineKeyboardButton(text="ʜᴇʟᴘ & ᴄᴏᴍᴍᴀɴᴅs", callback_data="help"), 14 | InlineKeyboardButton(text="ᴛᴜᴛᴜᴘ", callback_data="close"), 15 | ], 16 | ] 17 | return buttons 18 | if not FORCE_SUB_CHANNEL and FORCE_SUB_GROUP: 19 | buttons = [ 20 | [ 21 | InlineKeyboardButton(text="ɢʀᴏᴜᴘ", url=client.invitelink2), 22 | ], 23 | [ 24 | InlineKeyboardButton(text="ʜᴇʟᴘ & ᴄᴏᴍᴍᴀɴᴅs", callback_data="help"), 25 | InlineKeyboardButton(text="ᴛᴜᴛᴜᴘ", callback_data="close"), 26 | ], 27 | ] 28 | return buttons 29 | if FORCE_SUB_CHANNEL and not FORCE_SUB_GROUP: 30 | buttons = [ 31 | [ 32 | InlineKeyboardButton(text="ᴄʜᴀɴɴᴇʟ", url=client.invitelink), 33 | ], 34 | [ 35 | InlineKeyboardButton(text="ʜᴇʟᴘ & ᴄᴏᴍᴍᴀɴᴅs", callback_data="help"), 36 | InlineKeyboardButton(text="ᴛᴜᴛᴜᴘ", callback_data="close"), 37 | ], 38 | ] 39 | return buttons 40 | if FORCE_SUB_CHANNEL and FORCE_SUB_GROUP: 41 | buttons = [ 42 | [ 43 | InlineKeyboardButton(text="ʜᴇʟᴘ & ᴄᴏᴍᴍᴀɴᴅs", callback_data="help"), 44 | ], 45 | [ 46 | InlineKeyboardButton(text="ᴄʜᴀɴɴᴇʟ", url=client.invitelink), 47 | InlineKeyboardButton(text="ɢʀᴏᴜᴘ", url=client.invitelink2), 48 | ], 49 | [InlineKeyboardButton(text="ᴛᴜᴛᴜᴘ", callback_data="close")], 50 | ] 51 | return buttons 52 | 53 | 54 | def fsub_button(client, message): 55 | if not FORCE_SUB_CHANNEL and FORCE_SUB_GROUP: 56 | buttons = [ 57 | [ 58 | InlineKeyboardButton(text="ᴊᴏɪɴ ɢʀᴏᴜᴘ", url=client.invitelink2), 59 | ], 60 | ] 61 | try: 62 | buttons.append( 63 | [ 64 | InlineKeyboardButton( 65 | text="ᴄᴏʙᴀ ʟᴀɢɪ", 66 | url=f"https://t.me/{client.username}?start={message.command[1]}", 67 | ) 68 | ] 69 | ) 70 | except IndexError: 71 | pass 72 | return buttons 73 | if FORCE_SUB_CHANNEL and not FORCE_SUB_GROUP: 74 | buttons = [ 75 | [ 76 | InlineKeyboardButton(text="ᴊᴏɪɴ ᴄʜᴀɴɴᴇʟ", url=client.invitelink), 77 | ], 78 | ] 79 | try: 80 | buttons.append( 81 | [ 82 | InlineKeyboardButton( 83 | text="ᴄᴏʙᴀ ʟᴀɢɪ", 84 | url=f"https://t.me/{client.username}?start={message.command[1]}", 85 | ) 86 | ] 87 | ) 88 | except IndexError: 89 | pass 90 | return buttons 91 | if FORCE_SUB_CHANNEL and FORCE_SUB_GROUP: 92 | buttons = [ 93 | [ 94 | InlineKeyboardButton(text="ᴊᴏɪɴ ᴄʜᴀɴɴᴇʟ", url=client.invitelink), 95 | InlineKeyboardButton(text="ᴊᴏɪɴ ɢʀᴏᴜᴘ", url=client.invitelink2), 96 | ], 97 | ] 98 | try: 99 | buttons.append( 100 | [ 101 | InlineKeyboardButton( 102 | text="ᴄᴏʙᴀ ʟᴀɢɪ", 103 | url=f"https://t.me/{client.username}?start={message.command[1]}", 104 | ) 105 | ] 106 | ) 107 | except IndexError: 108 | pass 109 | return buttons 110 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # File-Sharing-Man 2 | 3 | Bot Telegram untuk menyimpan Posting atau File yang dapat Diakses melalui Link Khusus. 4 | Saya Kira Ini Akan Bermanfaat Bagi Banyak Orang. 5 | 6 | ## ⚠️ Disclaimer 7 | 8 | ``` 9 | Saya tidak bertanggung jawab atas penyalahgunaan bot ini. 10 | Bot ini dimaksudkan untuk membantu untuk menyimpan file yang diinginkan yang dapat diakses melalui Link Khusus. 11 | Gunakan bot ini dengan risiko Anda sendiri, dan gunakan bot ini dengan bijak. 12 | ``` 13 | 14 | ### Features 15 | - Sepenuhnya dapat dicustom. 16 | - Dapat di-deploy di heroku & vps. 17 | - Pesan sambutan & Forcesub yang dapat dicustom. 18 | - Lebih dari satu Posting dalam Satu Link (batch). 19 | - Fleksibel FSUB Button bisa 1 button atau 2 button menyesuaikan dengan var yang di isi. 20 | 21 | ### Setup 22 | 23 | - Tambahkan bot ke Channel Database dengan semua izin admin 24 | - Tambahkan bot ke Channel ForceSub tambahkan bot sebagai ADMIN 25 | - Tambahkan bot ke Group ForceSub tambahkan bot sebagai ADMIN 26 | 27 | ## 🛡 Installation 28 | ### Deploy on Heroku 29 | [![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://risman.vercel.app/file-deploy.html)
30 | 31 | **Tonton Video Tutorial Ini di YouTube untuk Bantuan memasang di Heroku**
32 | 33 | 34 |
35 | 36 |
37 |

🔗 Extra Custom & List Vars

38 | 39 | ### Variables 40 | 41 | * `API_HASH` Dapatkan API HASH di web my.telegram.org. 42 | * `API_ID` Dapatkan APP ID di web my.telegram.org 43 | * `TG_BOT_TOKEN` Dapatkan dari t.me/BotFather 44 | * `OWNER` Masukan Username Telegram untuk Owner BOT 45 | * `CHANNEL_ID` Masukan ID Channel Untuk [Channel Database] contoh:- -100xxxxxxxx 46 | * `ADMINS` Masukan User ID untuk mendapatkan hak Admin di BOT 47 | * `START_MESSAGE` Opsional: Pesan /start memulai awalan ke bot, Gunakan format parsemode HTML 48 | * `FORCE_SUB_MESSAGE` Opsional: Pesan Paksa Subscribe bot, Gunakan Format parsemode HTML 49 | * `FORCE_SUB_CHANNEL` Masukan ID dari Channel Untuk Wajib Subscribenya 50 | * `FORCE_SUB_GROUP` Masukan ID dari Group Untuk Wajib Subscribenya 51 | 52 | ### Extra Variables 53 | 54 | * `CUSTOM_CAPTION` letakkan teks teks Kustom Anda jika Anda ingin Mengatur Teks Kustom, Anda dapat menggunakan HTML dan fillings untuk pemformatan (hanya untuk dokumen) 55 | * `DISABLE_CHANNEL_BUTTON` Masukan True untuk Nonaktifkan Tombol Berbagi Saluran, Default jika False 56 | 57 | ### Fillings 58 | #### START_MESSAGE | FORCE_SUB_MESSAGE 59 | 60 | * `{first}` - User first name 61 | * `{last}` - User last name 62 | * `{id}` - User ID 63 | * `{mention}` - Mention the user 64 | * `{username}` - Username 65 | 66 | #### CUSTOM_CAPTION 67 | 68 | * `{filename}` - file name of the Document 69 | * `{previouscaption}` - Original Caption 70 | 71 |
72 | 73 | ## 🏷 Support 74 | - Follow Channel [@Lunatic0de](https://t.me/Lunatic0de) untuk info Update bot 75 | - Gabung Group [@SharingUserbot](https://t.me/SharingUserbot) untuk diskusi, pelaporan bug, dan bantuan tentang File-Sharing-Man. 76 | 77 | ## 👨🏻‍💻 Credits 78 | 79 | - [Dan](https://github.com/delivrance) for [Pyrogram](https://github.com/pyrogram/pyrogram) 80 | - [Risman](https://github.com/mrismanaziz) for [File-Sharing-Man](https://github.com/mrismanaziz/File-Sharing-Man) 81 | - Based on [CodeXBotz](https://github.com/CodeXBotz) Repo [File-Sharing-Bot](https://github.com/CodeXBotz/File-Sharing-Bot) 82 | 83 | ## 📑 License 84 | [![GNU GPLv3 Image](https://www.gnu.org/graphics/gplv3-127x51.png)](http://www.gnu.org/licenses/gpl-3.0.en.html) 85 | 86 | [FILE-SHARING-BOT](https://github.com/mrismanaziz/File-Sharing-Man/) is Free Software: You can use, study share and improve it at your 87 | will. Specifically you can redistribute and/or modify it under the terms of the 88 | [GNU General Public License](https://www.gnu.org/licenses/gpl.html) as 89 | published by the Free Software Foundation, either version 3 of the License, or 90 | (at your option) any later version. 91 | 92 | ## 93 | 94 | **Berikan Bintang Repo ini jika Anda menyukainya ⭐⭐⭐⭐⭐** 95 | 96 | -------------------------------------------------------------------------------- /plugins/link_generator.py: -------------------------------------------------------------------------------- 1 | # (©)Codexbotz 2 | # Recode by @mrismanaziz 3 | # t.me/SharingUserbot & t.me/Lunatic0de 4 | 5 | from pyrogram import Client, filters 6 | from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup, Message 7 | 8 | from bot import Bot 9 | from config import ADMINS 10 | from helper_func import encode, get_message_id 11 | 12 | 13 | @Bot.on_message(filters.private & filters.user(ADMINS) & filters.command("batch")) 14 | async def batch(client: Client, message: Message): 15 | while True: 16 | try: 17 | first_message = await client.ask( 18 | text="Silahkan Forward Pesan/File Pertama dari Channel DataBase. (Forward with Qoute)\n\natau Kirim Link Postingan dari Channel Database", 19 | chat_id=message.from_user.id, 20 | filters=(filters.forwarded | (filters.text & ~filters.forwarded)), 21 | timeout=60, 22 | ) 23 | except BaseException: 24 | return 25 | f_msg_id = await get_message_id(client, first_message) 26 | if f_msg_id: 27 | break 28 | await first_message.reply( 29 | "❌ ERROR\n\nPostingan yang Diforward ini bukan dari Channel Database saya", 30 | quote=True, 31 | ) 32 | continue 33 | 34 | while True: 35 | try: 36 | second_message = await client.ask( 37 | text="Silahkan Forward Pesan/File Terakhir dari Channel DataBase. (Forward with Qoute)\n\natau Kirim Link Postingan dari Channel Database", 38 | chat_id=message.from_user.id, 39 | filters=(filters.forwarded | (filters.text & ~filters.forwarded)), 40 | timeout=60, 41 | ) 42 | except BaseException: 43 | return 44 | s_msg_id = await get_message_id(client, second_message) 45 | if s_msg_id: 46 | break 47 | await second_message.reply( 48 | "❌ ERROR\n\nPostingan yang Diforward ini bukan dari Channel Database saya", 49 | quote=True, 50 | ) 51 | continue 52 | 53 | string = f"get-{f_msg_id * abs(client.db_channel.id)}-{s_msg_id * abs(client.db_channel.id)}" 54 | base64_string = await encode(string) 55 | link = f"https://t.me/{client.username}?start={base64_string}" 56 | reply_markup = InlineKeyboardMarkup( 57 | [ 58 | [ 59 | InlineKeyboardButton( 60 | "🔁 Share Link", url=f"https://telegram.me/share/url?url={link}" 61 | ) 62 | ] 63 | ] 64 | ) 65 | await second_message.reply_text( 66 | f"Link Sharing File Berhasil Di Buat:\n\n{link}", 67 | quote=True, 68 | reply_markup=reply_markup, 69 | ) 70 | 71 | 72 | @Bot.on_message(filters.private & filters.user(ADMINS) & filters.command("genlink")) 73 | async def link_generator(client: Client, message: Message): 74 | while True: 75 | try: 76 | channel_message = await client.ask( 77 | text="Silahkan Forward Pesan dari Channel DataBase. (Forward with Qoute)\n\natau Kirim Link Postingan dari Channel Database", 78 | chat_id=message.from_user.id, 79 | filters=(filters.forwarded | (filters.text & ~filters.forwarded)), 80 | timeout=60, 81 | ) 82 | except BaseException: 83 | return 84 | msg_id = await get_message_id(client, channel_message) 85 | if msg_id: 86 | break 87 | await channel_message.reply( 88 | "❌ ERROR\n\nPostingan yang Diforward ini bukan dari Channel Database saya", 89 | quote=True, 90 | ) 91 | continue 92 | 93 | base64_string = await encode(f"get-{msg_id * abs(client.db_channel.id)}") 94 | link = f"https://t.me/{client.username}?start={base64_string}" 95 | reply_markup = InlineKeyboardMarkup( 96 | [ 97 | [ 98 | InlineKeyboardButton( 99 | "🔁 Share Link", url=f"https://telegram.me/share/url?url={link}" 100 | ) 101 | ] 102 | ] 103 | ) 104 | await channel_message.reply_text( 105 | f"Link Sharing File Berhasil Di Buat:\n\n{link}", 106 | quote=True, 107 | reply_markup=reply_markup, 108 | ) 109 | -------------------------------------------------------------------------------- /helper_func.py: -------------------------------------------------------------------------------- 1 | # (©)Codexbotz 2 | # Recode by @mrismanaziz 3 | # t.me/SharingUserbot & t.me/Lunatic0de 4 | 5 | import asyncio 6 | import base64 7 | import re 8 | 9 | from pyrogram import filters 10 | from pyrogram.enums import ChatMemberStatus 11 | from pyrogram.errors import FloodWait 12 | from pyrogram.errors.exceptions.bad_request_400 import UserNotParticipant 13 | 14 | from config import ADMINS, FORCE_SUB_CHANNEL, FORCE_SUB_GROUP 15 | 16 | 17 | async def subschannel(filter, client, update): 18 | if not FORCE_SUB_CHANNEL: 19 | return True 20 | user_id = update.from_user.id 21 | if user_id in ADMINS: 22 | return True 23 | try: 24 | member = await client.get_chat_member( 25 | chat_id=FORCE_SUB_CHANNEL, user_id=user_id 26 | ) 27 | except UserNotParticipant: 28 | return False 29 | 30 | return member.status in [ChatMemberStatus.OWNER, ChatMemberStatus.ADMINISTRATOR, ChatMemberStatus.MEMBER] 31 | 32 | 33 | async def subsgroup(filter, client, update): 34 | if not FORCE_SUB_GROUP: 35 | return True 36 | user_id = update.from_user.id 37 | if user_id in ADMINS: 38 | return True 39 | try: 40 | member = await client.get_chat_member(chat_id=FORCE_SUB_GROUP, user_id=user_id) 41 | except UserNotParticipant: 42 | return False 43 | 44 | return member.status in [ChatMemberStatus.OWNER, ChatMemberStatus.ADMINISTRATOR, ChatMemberStatus.MEMBER] 45 | 46 | 47 | async def is_subscribed(filter, client, update): 48 | if not FORCE_SUB_CHANNEL: 49 | return True 50 | if not FORCE_SUB_GROUP: 51 | return True 52 | user_id = update.from_user.id 53 | if user_id in ADMINS: 54 | return True 55 | try: 56 | member = await client.get_chat_member(chat_id=FORCE_SUB_GROUP, user_id=user_id) 57 | except UserNotParticipant: 58 | return False 59 | try: 60 | member = await client.get_chat_member( 61 | chat_id=FORCE_SUB_CHANNEL, user_id=user_id 62 | ) 63 | except UserNotParticipant: 64 | return False 65 | 66 | return member.status in [ChatMemberStatus.OWNER, ChatMemberStatus.ADMINISTRATOR, ChatMemberStatus.MEMBER] 67 | 68 | 69 | async def encode(string): 70 | string_bytes = string.encode("ascii") 71 | base64_bytes = base64.urlsafe_b64encode(string_bytes) 72 | base64_string = (base64_bytes.decode("ascii")).strip("=") 73 | return base64_string 74 | 75 | async def decode(base64_string): 76 | base64_string = base64_string.strip("=") # links generated before this commit will be having = sign, hence striping them to handle padding errors. 77 | base64_bytes = (base64_string + "=" * (-len(base64_string) % 4)).encode("ascii") 78 | string_bytes = base64.urlsafe_b64decode(base64_bytes) 79 | string = string_bytes.decode("ascii") 80 | return string 81 | 82 | 83 | async def get_messages(client, message_ids): 84 | messages = [] 85 | total_messages = 0 86 | while total_messages != len(message_ids): 87 | temb_ids = message_ids[total_messages : total_messages + 200] 88 | try: 89 | msgs = await client.get_messages( 90 | chat_id=client.db_channel.id, message_ids=temb_ids 91 | ) 92 | except FloodWait as e: 93 | await asyncio.sleep(e.x) 94 | msgs = await client.get_messages( 95 | chat_id=client.db_channel.id, message_ids=temb_ids 96 | ) 97 | except BaseException: 98 | pass 99 | total_messages += len(temb_ids) 100 | messages.extend(msgs) 101 | return messages 102 | 103 | 104 | async def get_message_id(client, message): 105 | if ( 106 | message.forward_from_chat 107 | and message.forward_from_chat.id == client.db_channel.id 108 | ): 109 | return message.forward_from_message_id 110 | elif message.forward_from_chat or message.forward_sender_name or not message.text: 111 | return 0 112 | else: 113 | pattern = "https://t.me/(?:c/)?(.*)/(\\d+)" 114 | matches = re.match(pattern, message.text) 115 | if not matches: 116 | return 0 117 | channel_id = matches.group(1) 118 | msg_id = int(matches.group(2)) 119 | if channel_id.isdigit(): 120 | if f"-100{channel_id}" == str(client.db_channel.id): 121 | return msg_id 122 | elif channel_id == client.db_channel.username: 123 | return msg_id 124 | 125 | 126 | subsgc = filters.create(subsgroup) 127 | subsch = filters.create(subschannel) 128 | subsall = filters.create(is_subscribed) 129 | -------------------------------------------------------------------------------- /bot.py: -------------------------------------------------------------------------------- 1 | # (©)Codexbotz 2 | # Recode by @mrismanaziz 3 | # t.me/SharingUserbot & t.me/Lunatic0de 4 | 5 | import pyromod.listen 6 | import sys 7 | 8 | from pyrogram import Client, enums 9 | 10 | from config import ( 11 | API_HASH, 12 | APP_ID, 13 | CHANNEL_ID, 14 | FORCE_SUB_CHANNEL, 15 | FORCE_SUB_GROUP, 16 | LOGGER, 17 | OWNER, 18 | TG_BOT_TOKEN, 19 | TG_BOT_WORKERS, 20 | ) 21 | 22 | 23 | class Bot(Client): 24 | def __init__(self): 25 | super().__init__( 26 | name="Bot", 27 | api_hash=API_HASH, 28 | api_id=APP_ID, 29 | plugins={"root": "plugins"}, 30 | workers=TG_BOT_WORKERS, 31 | bot_token=TG_BOT_TOKEN, 32 | ) 33 | self.LOGGER = LOGGER 34 | 35 | async def start(self): 36 | try: 37 | await super().start() 38 | usr_bot_me = await self.get_me() 39 | self.username = usr_bot_me.username 40 | self.namebot = usr_bot_me.first_name 41 | self.LOGGER(__name__).info( 42 | f"TG_BOT_TOKEN detected!\n┌ First Name: {self.namebot}\n└ Username: @{self.username}\n——" 43 | ) 44 | except Exception as a: 45 | self.LOGGER(__name__).warning(a) 46 | self.LOGGER(__name__).info( 47 | "Bot Berhenti. Gabung Group https://t.me/SharingUserbot untuk Bantuan" 48 | ) 49 | sys.exit() 50 | 51 | if FORCE_SUB_CHANNEL: 52 | try: 53 | info = await self.get_chat(FORCE_SUB_CHANNEL) 54 | link = info.invite_link 55 | if not link: 56 | await self.export_chat_invite_link(FORCE_SUB_CHANNEL) 57 | link = info.invite_link 58 | self.invitelink = link 59 | self.LOGGER(__name__).info( 60 | f"FORCE_SUB_CHANNEL detected!\n┌ Title: {info.title}\n└ Chat ID: {info.id}\n——" 61 | ) 62 | except Exception as a: 63 | self.LOGGER(__name__).warning(a) 64 | self.LOGGER(__name__).warning( 65 | "Bot tidak dapat Mengambil link invite dari FORCE_SUB_CHANNEL!" 66 | ) 67 | self.LOGGER(__name__).warning( 68 | f"Pastikan @{self.username} adalah admin di Channel Tersebut, Chat ID F-Subs Channel Saat Ini: {FORCE_SUB_CHANNEL}" 69 | ) 70 | self.LOGGER(__name__).info( 71 | "Bot Berhenti. Gabung Group https://t.me/SharingUserbot untuk Bantuan" 72 | ) 73 | sys.exit() 74 | 75 | if FORCE_SUB_GROUP: 76 | try: 77 | info = await self.get_chat(FORCE_SUB_GROUP) 78 | link = info.invite_link 79 | if not link: 80 | await self.export_chat_invite_link(FORCE_SUB_GROUP) 81 | link = info.invite_link 82 | self.invitelink2 = link 83 | self.LOGGER(__name__).info( 84 | f"FORCE_SUB_GROUP detected!\n┌ Title: {info.title}\n└ Chat ID: {info.id}\n——" 85 | ) 86 | except Exception as a: 87 | self.LOGGER(__name__).warning(a) 88 | self.LOGGER(__name__).warning( 89 | "Bot tidak dapat Mengambil link invite dari FORCE_SUB_GROUP!" 90 | ) 91 | self.LOGGER(__name__).warning( 92 | f"Pastikan @{self.username} adalah admin di Group Tersebut, Chat ID F-Subs Group Saat Ini: {FORCE_SUB_GROUP}" 93 | ) 94 | self.LOGGER(__name__).info( 95 | "Bot Berhenti. Gabung Group https://t.me/SharingUserbot untuk Bantuan" 96 | ) 97 | sys.exit() 98 | 99 | try: 100 | db_channel = await self.get_chat(CHANNEL_ID) 101 | self.db_channel = db_channel 102 | test = await self.send_message(chat_id=db_channel.id, text="Test Message", disable_notification=True) 103 | await test.delete() 104 | self.LOGGER(__name__).info( 105 | f"CHANNEL_ID Database detected!\n┌ Title: {db_channel.title}\n└ Chat ID: {db_channel.id}\n——" 106 | ) 107 | except Exception as e: 108 | self.LOGGER(__name__).warning(e) 109 | self.LOGGER(__name__).warning( 110 | f"Pastikan @{self.username} adalah admin di Channel DataBase anda, CHANNEL_ID Saat Ini: {CHANNEL_ID}" 111 | ) 112 | self.LOGGER(__name__).info( 113 | "Bot Berhenti. Gabung Group https://t.me/SharingUserbot untuk Bantuan" 114 | ) 115 | sys.exit() 116 | 117 | self.set_parse_mode(enums.ParseMode.HTML) 118 | self.LOGGER(__name__).info( 119 | f"[🔥 BERHASIL DIAKTIFKAN! 🔥]\n\nBOT Dibuat oleh @{OWNER}\nJika @{OWNER} Membutuhkan Bantuan, Silahkan Tanyakan di Grup https://t.me/SharingUserbot" 120 | ) 121 | 122 | async def stop(self, *args): 123 | await super().stop() 124 | self.LOGGER(__name__).info("Bot stopped.") 125 | -------------------------------------------------------------------------------- /plugins/heroku.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2021-2022 by TeamYukki@Github, < https://github.com/TeamYukki >. 3 | # 4 | # This file is part of < https://github.com/TeamYukki/YukkiMusicBot > project, 5 | # and is released under the "GNU v3.0 License Agreement". 6 | # Please see < https://github.com/TeamYukki/YukkiMusicBot/blob/master/LICENSE > 7 | # 8 | # All rights reserved. 9 | # 10 | # Ported by @mrismanaziz 11 | # FROM File-Sharing-Man < https://github.com/mrismanaziz/File-Sharing-Man/ > 12 | # t.me/Lunatic0de & t.me/SharingUserbot 13 | # 14 | 15 | import os 16 | import socket 17 | 18 | import dotenv 19 | import heroku3 20 | import urllib3 21 | from bot import Bot 22 | from config import ADMINS, HEROKU_API_KEY, HEROKU_APP_NAME 23 | from pyrogram import filters 24 | from pyrogram.types import Message 25 | 26 | urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) 27 | if HEROKU_APP_NAME is not None and HEROKU_API_KEY is not None: 28 | Heroku = heroku3.from_key(HEROKU_API_KEY) 29 | HAPP = Heroku.app(HEROKU_APP_NAME) 30 | heroku_config = HAPP.config() 31 | else: 32 | HAPP = None 33 | 34 | XCB = [ 35 | "/", 36 | "@", 37 | ".", 38 | "com", 39 | ":", 40 | "git", 41 | "heroku", 42 | "push", 43 | str(HEROKU_API_KEY), 44 | "https", 45 | str(HEROKU_APP_NAME), 46 | "HEAD", 47 | "main", 48 | ] 49 | 50 | 51 | async def is_heroku(): 52 | return "heroku" in socket.getfqdn() 53 | 54 | 55 | @Bot.on_message(filters.command("getvar") & filters.user(ADMINS)) 56 | async def varget_(client: Bot, message: Message): 57 | if len(message.command) != 2: 58 | return await message.reply_text("Usage:\n/getvar [Var Name]") 59 | check_var = message.text.split(None, 2)[1] 60 | if await is_heroku(): 61 | if HAPP is None: 62 | return await message.reply_text( 63 | "Pastikan HEROKU_API_KEY dan HEROKU_APP_NAME anda dikonfigurasi dengan benar di config vars heroku" 64 | ) 65 | heroku_config = HAPP.config() 66 | if check_var in heroku_config: 67 | return await message.reply_text( 68 | f"{check_var}: {heroku_config[check_var]}" 69 | ) 70 | else: 71 | return await message.reply_text(f"Tidak dapat menemukan var {check_var}") 72 | else: 73 | path = dotenv.find_dotenv("config.env") 74 | if not path: 75 | return await message.reply_text(".env file not found.") 76 | output = dotenv.get_key(path, check_var) 77 | if not output: 78 | await message.reply_text(f"Tidak dapat menemukan var {check_var}") 79 | else: 80 | return await message.reply_text( 81 | f"{check_var}: {str(output)}" 82 | ) 83 | 84 | 85 | @Bot.on_message(filters.command("delvar") & filters.user(ADMINS)) 86 | async def vardel_(client: Bot, message: Message): 87 | if len(message.command) != 2: 88 | return await message.reply_text("Usage:\n/delvar [Var Name]") 89 | check_var = message.text.split(None, 2)[1] 90 | if await is_heroku(): 91 | if HAPP is None: 92 | return await message.reply_text( 93 | "Pastikan HEROKU_API_KEY dan HEROKU_APP_NAME anda dikonfigurasi dengan benar di config vars heroku" 94 | ) 95 | heroku_config = HAPP.config() 96 | if check_var in heroku_config: 97 | await message.reply_text(f"Berhasil Menghapus var {check_var}") 98 | del heroku_config[check_var] 99 | else: 100 | return await message.reply_text(f"Tidak dapat menemukan var {check_var}") 101 | else: 102 | path = dotenv.find_dotenv("config.env") 103 | if not path: 104 | return await message.reply_text(".env file not found.") 105 | output = dotenv.unset_key(path, check_var) 106 | if not output[0]: 107 | return await message.reply_text(f"Tidak dapat menemukan var {check_var}") 108 | else: 109 | await message.reply_text(f"Berhasil Menghapus var {check_var}") 110 | os.system(f"kill -9 {os.getpid()} && bash start") 111 | 112 | 113 | @Bot.on_message(filters.command("setvar") & filters.user(ADMINS)) 114 | async def set_var(client: Bot, message: Message): 115 | if len(message.command) < 3: 116 | return await message.reply_text("Usage:\n/setvar [Var Name] [Var Value]") 117 | to_set = message.text.split(None, 2)[1].strip() 118 | value = message.text.split(None, 2)[2].strip() 119 | if await is_heroku(): 120 | if HAPP is None: 121 | return await message.reply_text( 122 | "Pastikan HEROKU_API_KEY dan HEROKU_APP_NAME anda dikonfigurasi dengan benar di config vars heroku" 123 | ) 124 | heroku_config = HAPP.config() 125 | if to_set in heroku_config: 126 | await message.reply_text(f"Berhasil Mengubah var {to_set} menjadi {value}") 127 | else: 128 | await message.reply_text( 129 | f"Berhasil Menambahkan var {to_set} menjadi {value}" 130 | ) 131 | heroku_config[to_set] = value 132 | else: 133 | path = dotenv.find_dotenv("config.env") 134 | if not path: 135 | return await message.reply_text(".env file not found.") 136 | dotenv.set_key(path, to_set, value) 137 | if dotenv.get_key(path, to_set): 138 | await message.reply_text(f"Berhasil Mengubah var {to_set} menjadi {value}") 139 | else: 140 | await message.reply_text( 141 | f"Berhasil Menambahkan var {to_set} menjadi {value}" 142 | ) 143 | os.system(f"kill -9 {os.getpid()} && bash start") 144 | -------------------------------------------------------------------------------- /plugins/start.py: -------------------------------------------------------------------------------- 1 | # (©)Codexbotz 2 | # Recode by @mrismanaziz 3 | # t.me/SharingUserbot & t.me/Lunatic0de 4 | 5 | import asyncio 6 | from datetime import datetime 7 | from time import time 8 | 9 | from bot import Bot 10 | from config import ( 11 | ADMINS, 12 | CUSTOM_CAPTION, 13 | DISABLE_CHANNEL_BUTTON, 14 | FORCE_MSG, 15 | PROTECT_CONTENT, 16 | START_MSG, 17 | ) 18 | from database.sql import add_user, delete_user, full_userbase, query_msg 19 | from pyrogram import filters 20 | from pyrogram.enums import ParseMode 21 | from pyrogram.errors import FloodWait, InputUserDeactivated, UserIsBlocked 22 | from pyrogram.types import InlineKeyboardMarkup, Message 23 | 24 | from helper_func import decode, get_messages, subsall, subsch, subsgc 25 | 26 | from .button import fsub_button, start_button 27 | 28 | START_TIME = datetime.utcnow() 29 | START_TIME_ISO = START_TIME.replace(microsecond=0).isoformat() 30 | TIME_DURATION_UNITS = ( 31 | ("week", 60 * 60 * 24 * 7), 32 | ("day", 60**2 * 24), 33 | ("hour", 60**2), 34 | ("min", 60), 35 | ("sec", 1), 36 | ) 37 | 38 | 39 | async def _human_time_duration(seconds): 40 | if seconds == 0: 41 | return "inf" 42 | parts = [] 43 | for unit, div in TIME_DURATION_UNITS: 44 | amount, seconds = divmod(int(seconds), div) 45 | if amount > 0: 46 | parts.append(f'{amount} {unit}{"" if amount == 1 else "s"}') 47 | return ", ".join(parts) 48 | 49 | 50 | @Bot.on_message(filters.command("start") & filters.private & subsall & subsch & subsgc) 51 | async def start_command(client: Bot, message: Message): 52 | id = message.from_user.id 53 | user_name = ( 54 | f"@{message.from_user.username}" 55 | if message.from_user.username 56 | else None 57 | ) 58 | 59 | try: 60 | await add_user(id, user_name) 61 | except: 62 | pass 63 | text = message.text 64 | if len(text) > 7: 65 | try: 66 | base64_string = text.split(" ", 1)[1] 67 | except BaseException: 68 | return 69 | string = await decode(base64_string) 70 | argument = string.split("-") 71 | if len(argument) == 3: 72 | try: 73 | start = int(int(argument[1]) / abs(client.db_channel.id)) 74 | end = int(int(argument[2]) / abs(client.db_channel.id)) 75 | except BaseException: 76 | return 77 | if start <= end: 78 | ids = range(start, end + 1) 79 | else: 80 | ids = [] 81 | i = start 82 | while True: 83 | ids.append(i) 84 | i -= 1 85 | if i < end: 86 | break 87 | elif len(argument) == 2: 88 | try: 89 | ids = [int(int(argument[1]) / abs(client.db_channel.id))] 90 | except BaseException: 91 | return 92 | temp_msg = await message.reply("Tunggu Sebentar...") 93 | try: 94 | messages = await get_messages(client, ids) 95 | except BaseException: 96 | await message.reply_text("Telah Terjadi Error 🥺") 97 | return 98 | await temp_msg.delete() 99 | 100 | for msg in messages: 101 | 102 | if bool(CUSTOM_CAPTION) & bool(msg.document): 103 | caption = CUSTOM_CAPTION.format( 104 | previouscaption=msg.caption.html if msg.caption else "", 105 | filename=msg.document.file_name, 106 | ) 107 | 108 | else: 109 | caption = msg.caption.html if msg.caption else "" 110 | 111 | reply_markup = msg.reply_markup if DISABLE_CHANNEL_BUTTON else None 112 | try: 113 | await msg.copy( 114 | chat_id=message.from_user.id, 115 | caption=caption, 116 | parse_mode=ParseMode.HTML, 117 | protect_content=PROTECT_CONTENT, 118 | reply_markup=reply_markup, 119 | ) 120 | await asyncio.sleep(0.5) 121 | except FloodWait as e: 122 | await asyncio.sleep(e.x) 123 | await msg.copy( 124 | chat_id=message.from_user.id, 125 | caption=caption, 126 | parse_mode=ParseMode.HTML, 127 | protect_content=PROTECT_CONTENT, 128 | reply_markup=reply_markup, 129 | ) 130 | except BaseException: 131 | pass 132 | else: 133 | out = start_button(client) 134 | await message.reply_text( 135 | text=START_MSG.format( 136 | first=message.from_user.first_name, 137 | last=message.from_user.last_name, 138 | username=f"@{message.from_user.username}" 139 | if message.from_user.username 140 | else None, 141 | mention=message.from_user.mention, 142 | id=message.from_user.id, 143 | ), 144 | reply_markup=InlineKeyboardMarkup(out), 145 | disable_web_page_preview=True, 146 | quote=True, 147 | ) 148 | 149 | 150 | return 151 | 152 | 153 | @Bot.on_message(filters.command("start") & filters.private) 154 | async def not_joined(client: Bot, message: Message): 155 | buttons = fsub_button(client, message) 156 | await message.reply( 157 | text=FORCE_MSG.format( 158 | first=message.from_user.first_name, 159 | last=message.from_user.last_name, 160 | username=f"@{message.from_user.username}" 161 | if message.from_user.username 162 | else None, 163 | mention=message.from_user.mention, 164 | id=message.from_user.id, 165 | ), 166 | reply_markup=InlineKeyboardMarkup(buttons), 167 | quote=True, 168 | disable_web_page_preview=True, 169 | ) 170 | 171 | 172 | @Bot.on_message(filters.command(["users", "stats"]) & filters.user(ADMINS)) 173 | async def get_users(client: Bot, message: Message): 174 | msg = await client.send_message( 175 | chat_id=message.chat.id, text="Processing ..." 176 | ) 177 | users = await full_userbase() 178 | await msg.edit(f"{len(users)} Pengguna menggunakan bot ini") 179 | 180 | 181 | @Bot.on_message(filters.command("broadcast") & filters.user(ADMINS)) 182 | async def send_text(client: Bot, message: Message): 183 | if message.reply_to_message: 184 | query = await query_msg() 185 | broadcast_msg = message.reply_to_message 186 | total = 0 187 | successful = 0 188 | blocked = 0 189 | deleted = 0 190 | unsuccessful = 0 191 | 192 | pls_wait = await message.reply( 193 | "Broadcasting Message Tunggu Sebentar..." 194 | ) 195 | for row in query: 196 | chat_id = int(row[0]) 197 | if chat_id not in ADMINS: 198 | try: 199 | await broadcast_msg.copy(chat_id, protect_content=PROTECT_CONTENT) 200 | successful += 1 201 | except FloodWait as e: 202 | await asyncio.sleep(e.x) 203 | await broadcast_msg.copy(chat_id, protect_content=PROTECT_CONTENT) 204 | successful += 1 205 | except UserIsBlocked: 206 | await delete_user(chat_id) 207 | blocked += 1 208 | except InputUserDeactivated: 209 | await delete_user(chat_id) 210 | deleted += 1 211 | except BaseException: 212 | unsuccessful += 1 213 | total += 1 214 | status = f"""Berhasil Broadcast 215 | Jumlah Pengguna: {total} 216 | Berhasil: {successful} 217 | Gagal: {unsuccessful} 218 | Pengguna diblokir: {blocked} 219 | Akun Terhapus: {deleted}""" 220 | return await pls_wait.edit(status) 221 | else: 222 | msg = await message.reply( 223 | "Gunakan Perintah ini Harus Sambil Reply ke pesan telegram yang ingin di Broadcast." 224 | ) 225 | await asyncio.sleep(8) 226 | await msg.delete() 227 | 228 | 229 | @Bot.on_message(filters.command("ping")) 230 | async def ping_pong(client, m: Message): 231 | start = time() 232 | current_time = datetime.utcnow() 233 | uptime_sec = (current_time - START_TIME).total_seconds() 234 | uptime = await _human_time_duration(int(uptime_sec)) 235 | m_reply = await m.reply_text("Pinging...") 236 | delta_ping = time() - start 237 | await m_reply.edit_text( 238 | "PONG!!🏓 \n" 239 | f"• Pinger - {delta_ping * 1000:.3f}ms\n" 240 | f"• Uptime - {uptime}\n" 241 | ) 242 | 243 | 244 | @Bot.on_message(filters.command("uptime")) 245 | async def get_uptime(client, m: Message): 246 | current_time = datetime.utcnow() 247 | uptime_sec = (current_time - START_TIME).total_seconds() 248 | uptime = await _human_time_duration(int(uptime_sec)) 249 | await m.reply_text( 250 | "🤖 Bot Status:\n" 251 | f"• Uptime: {uptime}\n" 252 | f"• Start Time: {START_TIME_ISO}" 253 | ) 254 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | --------------------------------------------------------------------------------