Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---------------------------------------------------------------------------
- KeyError Traceback (most recent call last)
- File ~/.pyenv/versions/3.8.13/lib/python3.8/site-packages/pyrogram/methods/advanced/resolve_peer.py:62, in ResolvePeer.resolve_peer(self, peer_id)
- 61 try:
- ---> 62 return await self.storage.get_peer_by_id(peer_id)
- 63 except KeyError:
- File ~/.pyenv/versions/3.8.13/lib/python3.8/site-packages/pyrogram/storage/sqlite_storage.py:148, in SQLiteStorage.get_peer_by_id(self, peer_id)
- 147 if r is None:
- --> 148 raise KeyError(f"ID not found: {peer_id}")
- 150 return get_input_peer(*r)
- KeyError: 'ID not found: -100...'
- During handling of the above exception, another exception occurred:
- ValueError Traceback (most recent call last)
- Cell In[185], line 8
- 6 for chat in chats.chats:
- 7 if chat.title == "Заметки 100":
- ----> 8 await client.send_message(
- 9 int(f"-100{chat.id}"),
- 10 "test message",
- 11 )
- File ~/.pyenv/versions/3.8.13/lib/python3.8/site-packages/pyrogram/methods/messages/send_message.py:128, in SendMessage.send_message(self, chat_id, text, parse_mode, entities, disable_web_page_preview, disable_notification, reply_to_message_id, schedule_date, protect_content, reply_markup)
- 46 """Send text messages.
- 47
- 48 .. include:: /_includes/usable-by/users-bots.rst
- (...)
- 121 ]))
- 122 """
- 124 message, entities = (await utils.parse_text_entities(self, text, parse_mode, entities)).values()
- 126 r = await self.invoke(
- 127 raw.functions.messages.SendMessage(
- --> 128 peer=await self.resolve_peer(chat_id),
- 129 no_webpage=disable_web_page_preview or None,
- 130 silent=disable_notification or None,
- 131 reply_to_msg_id=reply_to_message_id,
- 132 random_id=self.rnd_id(),
- 133 schedule_date=utils.datetime_to_timestamp(schedule_date),
- 134 reply_markup=await reply_markup.write(self) if reply_markup else None,
- 135 message=message,
- 136 entities=entities,
- 137 noforwards=protect_content
- 138 )
- 139 )
- 141 if isinstance(r, raw.types.UpdateShortSentMessage):
- 142 peer = await self.resolve_peer(chat_id)
- File ~/.pyenv/versions/3.8.13/lib/python3.8/site-packages/pyrogram/methods/advanced/resolve_peer.py:89, in ResolvePeer.resolve_peer(self, peer_id)
- 86 except KeyError:
- 87 raise PeerIdInvalid
- ---> 89 peer_type = utils.get_peer_type(peer_id)
- 91 if peer_type == "user":
- 92 await self.fetch_peers(
- 93 await self.invoke(
- 94 raw.functions.users.GetUsers(
- (...)
- 102 )
- 103 )
- File ~/.pyenv/versions/3.8.13/lib/python3.8/site-packages/pyrogram/utils.py:246, in get_peer_type(peer_id)
- 243 elif 0 < peer_id <= MAX_USER_ID:
- 244 return "user"
- --> 246 raise ValueError(f"Peer id invalid: {peer_id}")
- ValueError: Peer id invalid: -100...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement