File-Sharing-Bot icon indicating copy to clipboard operation
File-Sharing-Bot copied to clipboard

How to add multiple channels?

Open sichokie opened this issue 1 year ago • 12 comments

How to add multiple channels in FORCE_SUB_CHANNEL if I want to give users multiple channel option to subscribe?

sichokie avatar Aug 15 '23 18:08 sichokie

I also Want To Know

itzmadara avatar Nov 06 '23 07:11 itzmadara

With the current way the feature is programmed it's impossible, it can only take one channel. However, i just reworked it in my fork so you can add as many channels as you want like this: FORCE_SUB_CHANNELS="ID1;ID2;ID3"

hazyfossa avatar Nov 10 '23 17:11 hazyfossa

Beware that this is in beta, and i'm currently waiting for maintainers to review the pull request #278 before this functionality becomes available

hazyfossa avatar Nov 10 '23 17:11 hazyfossa

Beware that this is in beta, and i'm currently waiting for maintainers to review the pull request #278 before this functionality becomes available

Where is your Repo

itzmadara avatar Nov 10 '23 21:11 itzmadara

It's here, or you can just patch the original according to this commit

hazyfossa avatar Nov 11 '23 05:11 hazyfossa

It's here, or you can just patch the original according to this commit

Put multiple FSUB Variable like admins

itzmadara avatar Nov 11 '23 06:11 itzmadara

It's here, or you can just patch the original according to this commit

There is an error python 3 can't open file main.py

itzmadara avatar Nov 11 '23 06:11 itzmadara

Oh right, main.py was just a simple import from bot, so i merged it with bot.py. Run bot.py instead

hazyfossa avatar Nov 11 '23 06:11 hazyfossa

With the current way the feature is programmed it's impossible, it can only take one channel. However, i just reworked it in my fork so you can add as many channels as you want like this: FORCE_SUB_CHANNELS="ID1;ID2;ID3"

i get this error

Traceback (most recent call last): File "/workspace/bot.py", line 12, in <module> from config import API_HASH, APP_ID, LOGGER, TG_BOT_TOKEN, TG_BOT_WORKERS, FORCE_SUB_CHANNELS, CHANNEL_ID, PORT File "/workspace/config.py", line 35, in <module> FORCE_SUB_CHANNELS = int(os.environ.get("FORCE_SUB_CHANNELS", "0")) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ValueError: invalid literal for int() with base 10: '-1001624775332;-1001551338411' Instance is unhealthy Instance is unhealthy Traceback (most recent call last): File "/workspace/bot.py", line 12, in <module> from config import API_HASH, APP_ID, LOGGER, TG_BOT_TOKEN, TG_BOT_WORKERS, FORCE_SUB_CHANNELS, CHANNEL_ID, PORT File "/workspace/config.py", line 35, in <module> FORCE_SUB_CHANNELS = int(os.environ.get("FORCE_SUB_CHANNELS", "0"))

cepheidev avatar Dec 13 '23 23:12 cepheidev

@cepheidev thx for the report, i think i fixed it now. I'm currently rewriting the config system, so things like this wont happen. Try to pull the update from the repo

hazyfossa avatar Dec 16 '23 09:12 hazyfossa

@cepheidev thx for the report, i think i fixed it now. I'm currently rewriting the config system, so things like this wont happen. Try to pull the update from the repo

thanks for the reply, i thought its never been fix, I'll wait for the fixed repo

cepheidev avatar Dec 16 '23 11:12 cepheidev

@cepheidev thx for the report, i think i fixed it now. I'm currently rewriting the config system, so things like this wont happen. Try to pull the update from the repo

do you have any update? because i cannot run it on koyeb

lunaticsm avatar Dec 25 '23 16:12 lunaticsm