Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG REPORT] Cannot cast NoneType to any kind of Peer. #390

Closed
1 task done
Exekutori opened this issue Nov 18, 2022 · 6 comments
Closed
1 task done

[BUG REPORT] Cannot cast NoneType to any kind of Peer. #390

Exekutori opened this issue Nov 18, 2022 · 6 comments
Labels
bug Something isn't working

Comments

@Exekutori
Copy link

Contact Details

@Shad0wReal

What happened?

A bug happened!
When i do .help and click on Plugin/some other buttons
it gives me back an error. See below 馃憤
awfawf

Version

0.7

Hosted On

Vps

Relevant logs output

pyUltLogs [ERROR] : Cannot cast NoneType to any kind of Peer.
Traceback (most recent call last):
  File "/home/Ultroid/pyUltroid/_misc/_assistant.py", line 77, in wrapper
    await func(event)
  File "/home/Ultroid/plugins/_inline.py", line 175, in help_func
    await ult.edit(text, buttons=page_num(count, key), link_preview=False)
  File "/home/Ultroid/venv/lib/python3.8/site-packages/telethon/events/callbackquery.py", line 341, in edit
    return await self._client.edit_message(
  File "/home/Ultroid/venv/lib/python3.8/site-packages/telethon/client/messages.py", line 1227, in edit_message
    entity = await self.get_input_entity(entity)
  File "/home/Ultroid/venv/lib/python3.8/site-packages/telethon/client/users.py", line 470, in get_input_entity
    peer = utils.get_peer(peer)
  File "/home/Ultroid/venv/lib/python3.8/site-packages/telethon/utils.py", line 997, in get_peer
    _raise_cast_fail(peer, 'Peer')
  File "/home/Ultroid/venv/lib/python3.8/site-packages/telethon/utils.py", line 138, in _raise_cast_fail
    raise TypeError('Cannot cast {} to any kind of {}.'.format(
TypeError: Cannot cast NoneType to any kind of Peer.

Acknowledgement

  • I have followed all of the above steps.
@Exekutori Exekutori added the bug Something isn't working label Nov 18, 2022
@New-dev0
Copy link
Member

@Shad0wGlitch Does this happen in one 2 one chat?

If yes, then try in saved messages or in public group

@Exekutori
Copy link
Author

yes on a chat with a friend.. I will try as you said but it does me also in private groups...

I will try

@Exekutori
Copy link
Author

Tried, same problem.

Oh and a second problem; I reinstalled Ultroid and i got this error:

11/19/2022, 16:57:16 | pyUltLogs [ERROR] : Could not find the input entity for PeerChannel(channel_id=1568054469) (PeerChannel). Please read https://docs.telethon.dev/en/latest/concepts/entities.html to find out more details.
Traceback (most recent call last):
  File "/home/ubot/Ultroid/pyUltroid/startup/funcs.py", line 218, in autopilot
    chat = await ultroid_bot.get_entity(channel)
  File "/usr/lib/python3.8/site-packages/telethon/client/users.py", line 314, in get_entity
    inputs.append(await self.get_input_entity(x))
  File "/usr/lib/python3.8/site-packages/telethon/client/users.py", line 499, in get_input_entity
    raise ValueError(
ValueError: Could not find the input entity for PeerChannel(channel_id=1568054469) (PeerChannel).

I already got Ultroid before, and i fixed this error with a simple restart..
Now it's not working (i got the ID with Kotatogram)

@TAMILVIP007
Copy link

@Shad0wGlitch Maybe u deleted ur .session file too it catches user info

@rooted-cyber
Copy link

Tried, same problem.

Oh and a second problem; I reinstalled Ultroid and i got this error:

11/19/2022, 16:57:16 | pyUltLogs [ERROR] : Could not find the input entity for PeerChannel(channel_id=1568054469) (PeerChannel). Please read https://docs.telethon.dev/en/latest/concepts/entities.html to find out more details.
Traceback (most recent call last):
  File "/home/ubot/Ultroid/pyUltroid/startup/funcs.py", line 218, in autopilot
    chat = await ultroid_bot.get_entity(channel)
  File "/usr/lib/python3.8/site-packages/telethon/client/users.py", line 314, in get_entity
    inputs.append(await self.get_input_entity(x))
  File "/usr/lib/python3.8/site-packages/telethon/client/users.py", line 499, in get_input_entity
    raise ValueError(
ValueError: Could not find the input entity for PeerChannel(channel_id=1568054469) (PeerChannel).

I already got Ultroid before, and i fixed this error with a simple restart.. Now it's not working (i got the ID with Kotatogram)

change redis and try

@Exekutori
Copy link
Author

@Shad0wGlitch Maybe u deleted ur .session file too it catches user info

Np, i reinstalled i had a problem with pip and i don't know why, but i recreated the venv and now works..

change redis and try

Also, I solved this problem by having the bot create the group and then copying the ID. And after restart it.

Another point is that the .help buttons works only in public groups and I only mean EXCLUSIVELY in public groups, neither saved messages nor private chats ...

@Exekutori Exekutori changed the title [BUG REPORT] [BUG REPORT] Cannot cast NoneType to any kind of Peer. Nov 19, 2022
@xditya xditya closed this as completed Dec 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants