diff --git a/Procfile b/Procfile deleted file mode 100644 index a561093..0000000 --- a/Procfile +++ /dev/null @@ -1 +0,0 @@ -worker: python3 bot.py \ No newline at end of file diff --git a/README.md b/README.md index aa86f9b..30e11c1 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,10 @@ -## Forward Tag Remover Bot 🤖 ->A Telegram Bot 🤖 to hide forward source - -
+# Forward Tag Remover Bot 🤖 -### 🤗Express Your ❤️ With A Star ⭐️ To The Repo And Donation😇 +>A Telegram Bot 🤖 to hide forward source +## 🤗Express Your ❤️ With A Star ⭐️ To The Repo And Donation😇 -``` +```bash Bitcoin -> bc1qt4andmh0f269rplanc27mvesnm24qg4pl235m2 @@ -21,8 +19,6 @@ qzl5kjhxrw73rcvr6ska3wzksu2vqsa20s4nt0ty8m ``` -
- [![ForTheBadge built-with-love](http://ForTheBadge.com/images/badges/built-with-love.svg)](https://GitHub.com/Artis7eeR/) [![made-with-python](https://img.shields.io/badge/Made%20with-Python-1f425f.svg)](https://www.python.org/) @@ -33,24 +29,18 @@ qzl5kjhxrw73rcvr6ska3wzksu2vqsa20s4nt0ty8m [![GitHub forks](https://img.shields.io/github/forks/Artis7eeR/ForwardTagRemoverBot.svg?style=social&label=Fork)](https://GitHub.com/Artis7eeR/ForwardTagRemoverBot/network/) [![GitHub stars](https://img.shields.io/github/stars/Artis7eeR/ForwardTagRemoverBot.svg?style=social&label=Star)](https://github.com/Artis7eeR/ForwardTagRemoverBot/) - -[**[See Our Video Here To Know How To Build Bot With Coding](https://youtu.be/swg6un2N4Fk)**]🎞️ - -
+[**[Tutorial Video](https://youtu.be/swg6un2N4Fk)**]🎞️ ### Features 🔥 - Hide **File Source** From Forwarded Files 😊 - Support For **Adding Caption** To Audio,Files,Video And Voice 😊 -
- ### Installation (Locally) 💻 >Make Sure You Have Python Installed On Your Device - -``` +```bash #Clone the repo👾 git clone https://github.com/Artis7eeR/ForwardTagRemoverBot.git @@ -60,27 +50,17 @@ qzl5kjhxrw73rcvr6ska3wzksu2vqsa20s4nt0ty8m #Install requirements🎯 pip install -r requirements.txt - #edit the bot token in config file📝 - nano config.py + #Add BOT_TOKEN to .env file + BOT_TOKEN= #Finally Run The Bot🤖 python bot.py ``` -
- -### Installation (Cloud) 🌩 - -[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/Artis7eer/ForwardTagRemoverBot/tree/main) - -
### Variables ⚙️ - **BOT_TOKEN: Get this value from [BotFather](https://telegram.dog/Botfather)** - -### [Demo Bot](https://telegram.dog/Anonforwabot) 🔥 -
+ **BOT_TOKEN: Get this value from [BotFather](https://telegram.dog/Botfather)** ## Bugs 🐞🐞 @@ -89,7 +69,4 @@ qzl5kjhxrw73rcvr6ska3wzksu2vqsa20s4nt0ty8m ### Contributions are Invited 🙂 -**©[Artis7eeR](https://github.com/Artis7eeR)** - - - +**©[Abdul Razaq](https://github.com/Artis7eeR)** diff --git a/app.json b/app.json deleted file mode 100644 index 1e57309..0000000 --- a/app.json +++ /dev/null @@ -1,14 +0,0 @@ -{ "name": "ForwardTagRemoverBot", - "description": " A Telegram Bot To Hide Forward Source", - "repository": "https://github.com/Artis7eeR/ForwardTagRemoverBot", - "logo": "https://telegra.ph/file/faacd4dd5b446769381f4.jpg", - "keywords": [ "bot","Artis7eeR", "telegram", "Rasak","TeamCyphers" ], - "success_url": "https://telegram.dog/Anonforwabot", - "env": { - "BOT_TOKEN": -{"description":"Get This Value from https://telegram.dog/BotFather", - "value": ""} -}, - "buildpacks": - [{ "url": "heroku/python" } ] - } diff --git a/bot.py b/bot.py index fa0d5ed..f6d9265 100644 --- a/bot.py +++ b/bot.py @@ -1,55 +1,45 @@ # ForwardTagRemoverBot - A Telegram Bot To Hide Forward Source -#Copyright (C) 2020 by Rasak -#ForwardTagRemoverBot is free software: you can redistribute it and/or modify -#it under the terms of the GNU General Public License as published by -#the Free Software Foundation, either version 3 of the License, or -#(at your option) any later version. - -#ForwardTagRemoverBot is distributed in the hope that it will be useful, -#but WITHOUT ANY WARRANTY; without even the implied warranty of -#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -#GNU General Public License for more details. - -#You should have received a copy of the GNU General Public License -#along with this program. If not, see . - - -from telegram.ext import Filters,Updater,MessageHandler,CommandHandler -from commands.commands import * -from functions.functions import * -from caption.setCaption import setCaption -import os +# Copyright (C) 2023 by Abdul Razaq +# ForwardTagRemoverBot is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# ForwardTagRemoverBot is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + + +import logging +from telegram.ext import ( + filters, + ApplicationBuilder, + CommandHandler, + MessageHandler +) + +from plugins.__main__ import * from config import Config -updater=Updater(Config.TOKEN,use_context=True) -dp=updater.dispatcher +logging.basicConfig( + format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', + level=logging.INFO +) -#/start -dp.add_handler(CommandHandler('start',startMessage)) -#/help -dp.add_handler(CommandHandler('help',helpMessage)) +def main(): + bot = ApplicationBuilder().token(Config.BOT_TOKEN).build() + bot.add_handler(CommandHandler('start', startMessage)) + bot.add_handler(CommandHandler('help', helpMessage)) + bot.add_handler(MessageHandler(filters.REPLY, handleCaption)) + bot.add_handler(MessageHandler( + filters.ALL & ~filters.COMMAND, handleMessage)) + bot.run_polling() -#Files -dp.add_handler(MessageHandler(Filters.document,sendFile)) -#Media -dp.add_handler(MessageHandler(Filters.video,sendMedia)) - -#Photos -dp.add_handler(MessageHandler(Filters.photo,sendPhoto)) - -#Text & Caption -dp.add_handler(MessageHandler(Filters.text,setCaption)) - -#Stickers -dp.add_handler(MessageHandler(Filters.sticker,sendSticker)) - -#Voice -dp.add_handler(MessageHandler(Filters.voice,sendVoice)) - -#Audio -dp.add_handler(MessageHandler(Filters.audio,sendAudio)) - -updater.start_polling() -updater.idle() +if __name__ == '__main__': + main() diff --git a/caption/setCaption.py b/caption/setCaption.py deleted file mode 100644 index ef879c2..0000000 --- a/caption/setCaption.py +++ /dev/null @@ -1,39 +0,0 @@ -# ForwardTagRemoverBot - A Telegram Bot To Hide Forward Source -#Copyright (C) 2020 by Rasak -#ForwardTagRemoverBot is free software: you can redistribute it and/or modify -#it under the terms of the GNU General Public License as published by -#the Free Software Foundation, either version 3 of the License, or -#(at your option) any later version. - -#ForwardTagRemoverBot is distributed in the hope that it will be useful, -#but WITHOUT ANY WARRANTY; without even the implied warranty of -#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -#GNU General Public License for more details. - -#You should have received a copy of the GNU General Public License -#along with this program. If not, see . - - - -#Function for adding caption -#to media such as audio,image,gifs and files -def setCaption(update,context): - if update.message.reply_to_message is not None: - fileCaption= update.message.text - fileType=update.message.reply_to_message - if fileType.document!=None: - update.message.reply_document( - update.message.reply_to_message.document.file_id,caption=fileCaption) - elif fileType.video!=None: - update.message.reply_video( - update.message.reply_to_message.video.file_id,caption=fileCaption) - elif fileType.audio!=None: - update.message.reply_audio( - update.message.reply_to_message.audio.file_id,caption=fileCaption) - elif fileType.voice!=None: - update.message.reply_voice( - update.message.reply_to_message.voice.file_id,caption=fileCaption) - elif fileType.photo!=None: - update.message.reply_photo(update.message.reply_to_message.photo[-1].file_id,caption=fileCaption) - else: - update.message.reply_text(update.message.text) diff --git a/commands/commands.py b/commands/commands.py deleted file mode 100644 index 352fac3..0000000 --- a/commands/commands.py +++ /dev/null @@ -1,45 +0,0 @@ -# ForwardTagRemoverBot - A Telegram Bot To Hide Forward Source -#Copyright (C) 2020 by Rasak -#ForwardTagRemoverBot is free software: you can redistribute it and/or modify -#it under the terms of the GNU General Public License as published by -#the Free Software Foundation, either version 3 of the License, or -#(at your option) any later version. - -#ForwardTagRemoverBot is distributed in the hope that it will be useful, -#but WITHOUT ANY WARRANTY; without even the implied warranty of -#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -#GNU General Public License for more details. - -#You should have received a copy of the GNU General Public License -#along with this program. If not, see . - -from telegram import InlineKeyboardButton, InlineKeyboardMarkup,ParseMode -from config import Config - -#Inline Keyboard Button -keyboard = [ -[ - InlineKeyboardButton("Source Code", url=Config.SOURCE) -], -[ - InlineKeyboardButton("How To Create A Bot Like Me",url="https://youtu.be/swg6un2N4Fk") -] -] - -#The Keyboard On Up👆 -reply_markup = InlineKeyboardMarkup(keyboard) - -#Send Start Message -def startMessage(update,context): - try: - update.message.reply_text(Config.START_TEXT.format(update.message.from_user.full_name,update.message.chat.id),reply_markup=reply_markup, -parse_mode=ParseMode.MARKDOWN) - except Exception as e: - update.message.reply_text(e) - -#Help Message -def helpMessage(update,context): - try: - update.message.reply_text(Config.HELP_TEXT,reply_markup=reply_markup,parse_mode=ParseMode.MARKDOWN) - except Exception as e: - update.message.reply_text(e) diff --git a/config.py b/config.py index 6285ac1..06a5027 100644 --- a/config.py +++ b/config.py @@ -1,25 +1,30 @@ # ForwardTagRemoverBot - A Telegram Bot To Hide Forward Source -#Copyright (C) 2020 by Rasak -#ForwardTagRemoverBot is free software: you can redistribute it and/or modify -#it under the terms of the GNU General Public License as published by -#the Free Software Foundation, either version 3 of the License, or -#(at your option) any later version. +# Copyright (C) 2023 by Abdul Razaq +# ForwardTagRemoverBot is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. -#ForwardTagRemoverBot is distributed in the hope that it will be useful, -#but WITHOUT ANY WARRANTY; without even the implied warranty of -#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -#GNU General Public License for more details. +# ForwardTagRemoverBot is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -#You should have received a copy of the GNU General Public License -#along with this program. If not, see . +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . import os +from dotenv import load_dotenv + +load_dotenv() class Config: - - TOKEN=os.environ.get("BOT_TOKEN",None) - SOURCE="https://github.com/Artis7eeR/ForwardTagRemoverBot" - START_TEXT="Hi [{}](tg://user?id={})\nI am A Forward Tag remover Bot.Send /help To Know What I Can Do \n ©Artis7eeR" - HELP_TEXT="Forward Me A File,Video,Audio,Photo or Anything And \nI will Send You the File Back\n\n`How to Set Caption?`\nReply Caption to a File,Photo,Audio,Media" - + + BOT_TOKEN = os.environ.get("BOT_TOKEN", None) + SOURCE = "https://github.com/Artis7eeR/ForwardTagRemoverBot" + START_TEXT = """ +Hi [{}](tg://user?id={}) +I am A Forward Tag remover Bot. +Send /help to know more ©[Abdul Razaq](https://github.com/artis7eer)""" + HELP_TEXT = "Forward Me A File,Video,Audio,Photo or Anything And \nI will Send You the File Back\n\n`How to Set Caption?`\nReply Caption to a File,Photo,Audio,Media" diff --git a/functions/functions.py b/functions/functions.py deleted file mode 100644 index a0f7025..0000000 --- a/functions/functions.py +++ /dev/null @@ -1,64 +0,0 @@ -# ForwardTagRemoverBot - A Telegram Bot To Hide Forward Source -#Copyright (C) 2020 by Rasak -#ForwardTagRemoverBot is free software: you can redistribute it and/or modify -#it under the terms of the GNU General Public License as published by -#the Free Software Foundation, either version 3 of the License, or -#(at your option) any later version. - -#ForwardTagRemoverBot is distributed in the hope that it will be useful, -#but WITHOUT ANY WARRANTY; without even the implied warranty of -#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -#GNU General Public License for more details. - -#You should have received a copy of the GNU General Public License -#along with this program. If not, see . - -#Function to send video -def sendMedia(update,context): - try: - update.message.reply_video(update.message.video.file_id) - except Exception as e: - update.message.reply_text(e) - -#Function to send file -def sendFile(update,context): - try: - update.message.reply_document(update.message.document.file_id) - except Exception as e: - update.message.reply_text(e) - -#Function to send image -def sendPhoto(update,context): - try: - update.message.reply_photo(update.message.photo[-1].file_id) - except Exception as e: - update.message.reply_text(e) - -#Function to send text messages -def sendText(update,context): - try: - update.message.reply_text(update.message.text) - except Exception as e: - update.message.reply_text(e) - -#Function to send sticker -def sendSticker(update,context): - try: - update.message.reply_sticker(update.message.sticker.file_id) - except Exception as e: - update.message.reply_text(e) - -#Function to send voice -def sendVoice(update,context): - try: - update.message.reply_voice(update.message.voice.file_id) - except Exception as e: - update.message.reply_text(e) - -#function to send audio -def sendAudio(update,context): - try: - update.message.reply_audio(update.message.audio.file_id) - except Exception as e: - update.message.reply_text(e) - diff --git a/plugins/__main__.py b/plugins/__main__.py new file mode 100644 index 0000000..eeef31b --- /dev/null +++ b/plugins/__main__.py @@ -0,0 +1,2 @@ +from plugins.functions import * +from plugins.caption import * \ No newline at end of file diff --git a/plugins/caption.py b/plugins/caption.py new file mode 100644 index 0000000..8ce9e52 --- /dev/null +++ b/plugins/caption.py @@ -0,0 +1,21 @@ +# ForwardTagRemoverBot - A Telegram Bot To Hide Forward Source +# Copyright (C) 2023 by Abdul Razaq +# ForwardTagRemoverBot is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# ForwardTagRemoverBot is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + + +async def handleCaption(_, bot): + if _.message.reply_to_message is not None: + # Get Caption from message + file_caption = _.message.text or "" + await _.message.reply_copy(_.effective_user.id,message_id = _.message.reply_to_message.message_id,caption = file_caption) diff --git a/plugins/functions.py b/plugins/functions.py new file mode 100644 index 0000000..0968f3e --- /dev/null +++ b/plugins/functions.py @@ -0,0 +1,44 @@ +# ForwardTagRemoverBot - A Telegram Bot To Hide Forward Source +# Copyright (C) 2023 by Abdul Razaq +# ForwardTagRemoverBot is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# ForwardTagRemoverBot is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +from telegram import InlineKeyboardButton, InlineKeyboardMarkup +from telegram.constants import ParseMode +from config import Config + +keyboard = [ + [ + InlineKeyboardButton("Source Code", url=Config.SOURCE) + ], + [ + InlineKeyboardButton("How To Create A Bot Like Me", + url="https://youtu.be/swg6un2N4Fk") + ] +] + +reply_markup = InlineKeyboardMarkup(keyboard) + + +async def startMessage(_, bot): + await _.message.reply_text(Config.START_TEXT.format(_.message.from_user.full_name, _.message.chat.id), reply_markup=reply_markup, + parse_mode=ParseMode.MARKDOWN) + + +async def helpMessage(_, bot): + await _.message.reply_text(Config.HELP_TEXT, reply_markup=reply_markup, parse_mode=ParseMode.MARKDOWN) + + +async def handleMessage(_, bot): + + await _.message.copy(_.effective_user.id) diff --git a/requirements.txt b/requirements.txt index 11a50f9..4ef0c38 100644 Binary files a/requirements.txt and b/requirements.txt differ diff --git a/runtime.txt b/runtime.txt deleted file mode 100644 index f72c511..0000000 --- a/runtime.txt +++ /dev/null @@ -1 +0,0 @@ -python-3.9.0