├── runtime.txt ├── Procfile ├── requirements.txt ├── config.py ├── translation.py ├── Plugins ├── forward.py └── commands.py ├── bot.py ├── README.md └── app.json /runtime.txt: -------------------------------------------------------------------------------- 1 | python-3.8.6 2 | -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | worker: python3 bot.py 2 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | https://github.com/Mahesh0253/pyrogram/archive/beta.zip 2 | tgcrypto 3 | -------------------------------------------------------------------------------- /config.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | class Config(object): 4 | BOT_TOKEN = os.environ.get("TG_BOT_TOKEN", "") 5 | API_ID = int(os.environ.get("APP_ID", 12345)) 6 | API_HASH = os.environ.get("API_HASH") 7 | CHANNEL = list(x for x in os.environ.get("CHANNEL_ID", "").replace("\n", " ").split(' ')) 8 | -------------------------------------------------------------------------------- /translation.py: -------------------------------------------------------------------------------- 1 | class Translation(object): 2 | 3 | # Start text 4 | START = "Hi I am a channel auto forward bot clone of Auto Forward Bot. \nMake your own bot now 👉 Source code \n\nSupport Group and Developer:\n @musicwithalby, @i_am_albin_praveen" 5 | 6 | #About text 7 | ABOUT = """ 8 | 📝 Language: Python 3 9 | 🧰 Framework: Pyrogram 10 | 👨💻 Developer: @i_am_albin_praveen 11 | 👥 Group: Ns @musicwithalby 12 | 🌐Source Code: Press Me 🥰""" 13 | -------------------------------------------------------------------------------- /Plugins/forward.py: -------------------------------------------------------------------------------- 1 | import logging 2 | logging.basicConfig(level=logging.DEBUG, 3 | format='%(asctime)s - %(name)s - %(levelname)s - %(message)s') 4 | logger = logging.getLogger(__name__) 5 | 6 | import asyncio 7 | from pyrogram import filters 8 | from bot import channelforward 9 | from config import Config 10 | 11 | @channelforward.on_message(filters.channel) 12 | async def forward(c, m): 13 | # Forwarding the messages to the channel 14 | 15 | for id in Config.CHANNEL: 16 | from_channel, to_channel = id.split(":") 17 | if m.chat.id == int(from_channel): 18 | await m.forward(int(to_channel), as_copy=True) 19 | print("Forwarded a message from", from_channel, "to", to_channel) 20 | asyncio.sleep(1) 21 | -------------------------------------------------------------------------------- /bot.py: -------------------------------------------------------------------------------- 1 | import pyrogram 2 | 3 | import logging 4 | logging.basicConfig(level=logging.DEBUG, 5 | format='%(asctime)s - %(name)s - %(levelname)s - %(message)s') 6 | logger = logging.getLogger(__name__) 7 | 8 | import os 9 | 10 | from config import Config 11 | from pyrogram import Client 12 | logging.getLogger("pyrogram").setLevel(logging.WARNING) 13 | 14 | class channelforward(Client): 15 | 16 | def __init__(self): 17 | super().__init__( 18 | session_name="CHANNELFORWARD", 19 | bot_token = Config.BOT_TOKEN, 20 | api_id = Config.API_ID, 21 | api_hash = Config.API_HASH, 22 | workers = 20, 23 | plugins = dict( 24 | root="Plugins" 25 | ) 26 | ) 27 | 28 | if __name__ == "__main__" : 29 | channelforward().run() 30 | 31 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [](https://github.com/ALBINPRAVEEN/Autoforwardbot) 4 | [](https://telegram.dog/i_am_albin_praveen) 5 | 6 | ## How to Deploy? 🤔 7 | [](https://heroku.com/deploy?template=https://github.com/ALBINPRAVEEN/Autoforwardbot) 8 | - 👆 Press the deploy button. 9 | 10 | - Go to [my.telegram.org](https://my.telegram.org/) 11 | - And get your API ID 12 | - And API Hashes 13 | 14 | - Paste the below API_HASH and API_ID respectively. 15 | 16 | - Get the your channel id and paste in below in the format -10023352648:-100655379 17 | - In the about format -10023352648 is the channel from which you need to forward 18 | - and -100655379 is the channel to which you wanted to forward 19 | [
](https://telegram.dog/i_am_albin_praveen)
20 |
21 | - Get the Bot Father Token from [@BotFather](https://telegram.dog/botfather)
22 |
23 | - Paste the token below TG_BOT_TOKEN.
24 |
25 |
26 | ## COMMANDS
27 | ### AVAILABLE COMMANDS
28 | ```
29 | start - check whether bot is alive
30 |
31 | about - to know about me
32 | ```
33 |
34 |
--------------------------------------------------------------------------------
/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Channel Auto forward bot",
3 | "description": "Telegram auto forwarding bot. Create your Fork now.",
4 | "keywords": [
5 | "telegram",
6 | "best",
7 | "forward"
8 | ],
9 | "logo": "https://telegra.ph/file/5b5dd216d70b29c80e25e.jpg",
10 | "success_url": "https://telegram.dog/i_am_albin_praveen",
11 | "website": "https://github.com/ALBINPRAVEEN/Autoforwardbot",
12 | "repository": "https://github.com/Ns-AnoNymouS/TG-CONVERT-BOT",
13 | "env": {
14 | "WEBHOOK": {
15 | "description": "Setting this to ANYTHING will enable webhooks when in env mode",
16 | "value": "ANYTHING"
17 | },
18 | "TG_BOT_TOKEN": {
19 | "description": "Your bot token, as a string.",
20 | "value": ""
21 | },
22 | "APP_ID": {
23 | "description": "Get this value from https://my.telegram.org",
24 | "value": ""
25 | },
26 | "CHANNEL_ID": {
27 | "description": "your channel id in format -12352626:-34466(from channel id:to channel id) if you want to give more channels seperate them with white space",
28 | "value": ""
29 | },
30 | "API_HASH": {
31 | "description": "Get this value from https://my.telegram.org",
32 | "value": ""
33 | }
34 | },
35 | "addons": [
36 | ],
37 | "buildpacks": [{
38 | "url": "https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest"
39 | }, {
40 | "url": "heroku/python"
41 | }],
42 | "formation": {
43 | "worker": {
44 | "quantity": 1,
45 | "size": "free"
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/Plugins/commands.py:
--------------------------------------------------------------------------------
1 | import logging
2 | logging.basicConfig(level=logging.DEBUG,
3 | format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
4 | logger = logging.getLogger(__name__)
5 |
6 |
7 | import pyrogram
8 | from pyrogram import filters
9 | from bot import channelforward
10 | from config import Config
11 | from translation import Translation
12 |
13 |
14 | ########################################################################################################################################################################################################
15 | # start command
16 |
17 | @channelforward.on_message(filters.command(["start"]))
18 | async def start(c, m):
19 | await c.send_message(chat_id=m.chat.id,
20 | text=Translation.START,
21 | parse_mode="html",
22 | disable_web_page_preview=True,
23 | reply_to_message_id=m.message_id)
24 |
25 | ################################################################################################################################################################################################################################################
26 | # about command
27 |
28 | @channelforward.on_message(filters.command(["about"]))
29 | async def about(c, m):
30 | await c.send_message(chat_id=m.chat.id,
31 | text=Translation.ABOUT,
32 | parse_mode="html",
33 | disable_web_page_preview=True,
34 | reply_to_message_id=m.message_id)
35 |
36 | ################################################################################################################################################################################################################################################
37 |
--------------------------------------------------------------------------------