Giter VIP home page Giter VIP logo

Comments (3)

Arduingo avatar Arduingo commented on August 20, 2024 2

I think I found what the problem is, the Saved Messages Chat is not seen by Telegram as a Chat but as a User, so when we execute peerChannel = PeerChannel(channel_id) we get an error.

I fixed my problem by removing that line and replacing by peerChannel = channel_id, filtering the event by using client.on(events.NewMessage(chats=channel_id) instead of the if inside and removing the if statement comparing if the event if from the user selected chat. if event.to_id != peerChannel:

so the code ended being
...
queue = asyncio.Queue()
#peerChannel = PeerChannel(channel_id)
peerChannel = channel_id

@client.on(events.NewMessage(chats=channel_id))
async def handler(event):
            
    #if event.to_id != peerChannel:
    #    return

    print(event)
    
    try:

...

Now the script allow me to use the saved messages as my "media storage", the detail to have into account is if you want to use a different chat then the Saved Messages you should remove the negative sign from the Chat ID you want to use.

I don't know if I broke something else, I'm testing, so far so good

from telegram-download-daemon.

alfem avatar alfem commented on August 20, 2024

I would need to know how yo use this script. Are you using your own Saved Message for downloads or are you forwarding files from your Saved Message chat to another one?

How did you get the chat_id of "Saved Messages"?

from telegram-download-daemon.

Arduingo avatar Arduingo commented on August 20, 2024

Hi,

For the Chat ID I used Telegram Web, and used the last part of the URL for example

https://web.telegram.org/z/#123456789, so the chat ID would be 123456789, one difference I found is that this Chat ID is a positive number while If i look into a channel I created the number is negative.

I forward Media from others chats to my Saved Message folder

from telegram-download-daemon.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.