Giter VIP home page Giter VIP logo

Comments (16)

aahnik avatar aahnik commented on July 23, 2024

@ankit-sinha-18, you created a good issue. I never noticed this before. Hopefully, this will be fixed in the next release. read #43

make sure to star and watch this repository, to stay updated.

from tgcf.

ankit-sinha-18 avatar ankit-sinha-18 commented on July 23, 2024

Okay, Thank you...

I have a doubt,
Can't poll / Quiz be forwarded without forward tag?
because,I have used unofficial version of telegram like plus messenger,telegraph,bgram..
In All these apps,when forwarding poll / Quiz without quotes,It gets forwarded with quotes automatcally.

from tgcf.

aahnik avatar aahnik commented on July 23, 2024

@ankit-sinha-18 does this error still occur? the screenshot you showed is of the old version.

please try again with a new version

from tgcf.

aahnik avatar aahnik commented on July 23, 2024

Can't poll / Quiz be forwarded without forward tag?
because,I have used unofficial version of telegram like plus messenger,telegraph,bgram..
In All these apps,when forwarding poll / Quiz without quotes,It gets forwarded with quotes automatically.

i cant understand. please show a screenshot for this.

from tgcf.

aahnik avatar aahnik commented on July 23, 2024

@ankit-sinha-18, I tested with the new version, and this error does not occur anymore.

after the major release of tgcf 0.1.17, this issue is solved, due to a deep change in how tgcf works.

from tgcf.

ankit-sinha-18 avatar ankit-sinha-18 commented on July 23, 2024

https://user-images.githubusercontent.com/72637068/117160348-aa832b00-adde-11eb-8f23-7371eda6eb43.png

This error occurred again in tgcf new version.

You can check it's version,it is 0.1.27

from tgcf.

aahnik avatar aahnik commented on July 23, 2024

please don't use screenshots, copy and paste the error message.

are you using termux?

the poll object forwarding is happening smoothly in my computer. need to check for termux.

from tgcf.

ankit-sinha-18 avatar ankit-sinha-18 commented on July 23, 2024

Yes,I am using it in termux

ERROR:root:Cannot use <telethon.tl.types.MessageMediaPoll object at 0x713713a700> as file
Traceback (most recent call last):
  File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/tgcf/past.py", line 32, in forward_job
    await send_message(client, destination, message)
  File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/tgcf/utils.py", line 8, in send_message
    return await client.send_message(*args)
  File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/telethon/client/messages.py", line 782, in send_message
    return await self.send_file(
  File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/telethon/client/uploads.py", line 386, in send_file
    raise TypeError('Cannot use {!r} as file'.format(file))
TypeError: Cannot use <telethon.tl.types.MessageMediaPoll object at 0x713713a700> as file
INFO:telethon.network.mtprotosender:Disconnecting from 149.154.175.59:443/TcpFull...
INFO:telethon.network.mtprotosender:Disconnection from 149.154.175.59:443/TcpFull complete!

from tgcf.

ankit-sinha-18 avatar ankit-sinha-18 commented on July 23, 2024

I got the same error in Heroku

ERROR:root:Cannot use <telethon.tl.types.MessageMediaPoll object at 0x7f1df78e0f10> as file
Traceback (most recent call last):
  File "/app/.heroku/python/lib/python3.9/site-packages/tgcf/past.py", line 34, in forward_job
    await send_message(client, destination, message)
  File "/app/.heroku/python/lib/python3.9/site-packages/tgcf/utils.py", line 8, in send_message
    return await client.send_message(*args)
  File "/app/.heroku/python/lib/python3.9/site-packages/telethon/client/messages.py", line 782, in send_message
    return await self.send_file(
  File "/app/.heroku/python/lib/python3.9/site-packages/telethon/client/uploads.py", line 386, in send_file
    raise TypeError('Cannot use {!r} as file'.format(file))
TypeError: Cannot use <telethon.tl.types.MessageMediaPoll object at 0x7f1df78e0f10> as file
INFO:telethon.network.mtprotosender:Disconnecting from 149.154.175.59:443/TcpFull...
INFO:telethon.network.mtprotosender:Disconnection from 149.154.175.59:443/TcpFull complete!

from tgcf.

aahnik avatar aahnik commented on July 23, 2024

hi @ankit-sinha-18 , did you use official app to create the poll ? i could not reproduce this error.

try creating the poll with official app.

and what have you set to show_forwarded_from ? please show me your config file.

from tgcf.

ankit-sinha-18 avatar ankit-sinha-18 commented on July 23, 2024

As you can see ,that error is
ERROR:root:Cannot use <telethon.tl.types.MessageMediaPoll object at 0x7f1df78e0f10> as file

But ,in actual that is not Poll ,that is quiz.
When using tgcf in past mode,it couldn't forward quiz object
And program crashed at that time,

You can reproduce this error , make a quiz in from Channel and try to forward in another channel,you will get same error message, which I am getting.

from tgcf.

aahnik avatar aahnik commented on July 23, 2024

a quiz is a poll in quiz mode.

and after turning quiz mode on, I was able to reproduce the error. I cant do anything about it, because it is problem with telethon.

but what I can do, is prevent the stopping of script. it will show an error on terminal, and then continue with next message.

this error occurs for both past and live mode

from tgcf.

ankit-sinha-18 avatar ankit-sinha-18 commented on July 23, 2024

Yes, similar problem occurs in pyrogram also.
Quiz is forwarded as copy in pyrogram but it becomes Poll when it is copied. So this is another type of problem in pyrogram also.

Yes,you can do something to prevent the stopping of script and skip the quiz object

from tgcf.

aahnik avatar aahnik commented on July 23, 2024

Hi @ankit-sinha-18 , try forwarding quiz poll, with show_forwarded_from set to true.

(Read wiki)

Then it is supposed to work.

Try and tell me.

from tgcf.

ankit-sinha-18 avatar ankit-sinha-18 commented on July 23, 2024

But I don't need quiz as forwarded tag, I want them as a copy.
I know,It is not going to be forwarded without quote..

So, setting show_forwarded_from true is the only way to bypass error in tgcf!!?

from tgcf.

aahnik avatar aahnik commented on July 23, 2024

hi @ankit-sinha-18, if there is an error, tgcf past mode will not stop. (show_forwarded_from can either be true or false)

but you cannot send a quiz poll object. you can only forward it. (becos telethon does not allow so)

send means = a fresh message is sent ("forwarded from" is not shown on top )
forward means = "forwarded from" is shown

from tgcf.

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.