Ayush7445 / telegram-forwarder_auto

A telegram forwarder that will automatically post message form Another telegram channel / group to Your telegram channel / group
GNU General Public License v3.0
240 stars 512 forks source link

Please Help #6

Closed Lida1606 closed 2 years ago

Lida1606 commented 2 years ago

Traceback (most recent call last): File "/home/pi/Desktop/Telegrambots/telegram-forwarder_auto/bot.py", line 24, in APP_ID = config("APP_ID", default=None, cast=int) File "/home/pi/.local/lib/python3.9/site-packages/decouple.py", line 243, in call return self.config(*args, *kwargs) File "/home/pi/.local/lib/python3.9/site-packages/decouple.py", line 105, in call return self.get(args, **kwargs) File "/home/pi/.local/lib/python3.9/site-packages/decouple.py", line 99, in get return cast(value) TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'

devmexican commented 2 years ago

That is because the variables are not configured, you can replace that data with an environment variable, to protect your information or place the values to do the tests.

ahmedhasanhg commented 2 years ago

please help i finished the app but still no messages forwarded note im forwarding messages from a bot to a group

devmexican commented 2 years ago

If it is the first time, it will ask for your phone number and send a code to your telegram app. Luck.

Basics

APP_ID = app_id API_HASH =api_hash

try: BotzHubUser = TelegramClient('name', APP_ID, API_HASH) BotzHubUser.start() except Exception as ap: print(f"ERROR - {ap}") exit(1)

id_channel From

@BotzHubUser.on(events.NewMessage(incoming=True, chats=id_channel)) async def sender_bH(event):

id_channel to

await client.forward_messages(idchannel,event.message)

print("Bot has started.") BotzHubUser.run_until_disconnected()

ahmedhasanhg commented 2 years ago

its the first time and i got the phone number code already and the bot has started but still no messages forwarded and i tried 2 times and deleted the app and do it again and still the same problem

devmexican commented 2 years ago

If I already send you the code it means that we are doing well Can you paste your code, so I can see the forwarding option?

ahmedhasanhg commented 2 years ago

im sorry i was trying to forward messages from bot to channel is it possible ?

On Thu, Apr 21, 2022 at 9:33 PM devmexican @.***> wrote:

If I already send you the code it means that we are doing well Can you paste your code, so I can see the forwarding option?

— Reply to this email directly, view it on GitHub https://github.com/Ayush7445/telegram-forwarder_auto/issues/6#issuecomment-1105674708, or unsubscribe https://github.com/notifications/unsubscribe-auth/AY2CB5EVIBP5RVZFJNN333DVGGUQRANCNFSM5TIFM3JQ . You are receiving this because you commented.Message ID: @.***>

devmexican commented 2 years ago

of course it is possible