Пожалуйста, обратите внимание, что пользователь заблокирован
So i have been working on this project and seem to have got stuck with a few different parts of it and was wondering if anyone is either willing to contribute a bit of their time / knowledge / skill into it.
This is the main interface of the screen that will import and log Token Data and allow the user to manipulate the tokens with the various commands on the right hand side.
In this part whenever i goto highlight the token on the table and hit "Dump Msgs" i get this error
"Error dumping messages: '>' not supported between instances of 'int' and 'NoneType'"
Anyone that can help or even provide any kind of assistance or if they are interested in working on the project with me, just let me know
This is the main interface of the screen that will import and log Token Data and allow the user to manipulate the tokens with the various commands on the right hand side.
In this part whenever i goto highlight the token on the table and hit "Dump Msgs" i get this error
"Error dumping messages: '>' not supported between instances of 'int' and 'NoneType'"
Python:
async def dumpMessages(self):
if not self.dialog:
self.console_text_edit_2.append("No dialog selected. Please select a chat or channel first.")
return
messages_by_chat = {}
messages_by_chat[self.dialog.id] = []
batch_size = 100
messages = []
processed_messages = 0
try:
last_message_id = self.get_last_dumped_message_id(self.dialog.id)
total_messages = (await self.client.get_messages(self.dialog, limit=None)).total
# Check for None
if total_messages is None:
self.console_text_edit_2.append("Failed to retrieve total messages.")
return
# Get the chat ID from the text input
target_chat_id = self.telegram_chat_id_text_input.toPlainText() # Assuming this is a QLineEdit or similar
async for message in self.client.iter_messages(self.dialog, offset_id=last_message_id):
messages.append(message)
processed_messages += 1
# Forward the message to the target chat ID
if target_chat_id:
await self.client.send_message(target_chat_id, message)
if len(messages) >= batch_size:
messages_by_chat[self.dialog.id].extend(messages)
await self.write_messages_to_file(self.dialog.id, messages_by_chat[self.dialog.id])
self.save_last_dumped_message_id(self.dialog.id, message.id)
messages = []
# Update progress
progress = (processed_messages / total_messages) * 100
self.update_progress_bar(progress)
await asyncio.sleep(0.1)
# Process remaining messages
if messages:
messages_by_chat[self.dialog.id].extend(messages)
await self.write_messages_to_file(self.dialog.id, messages_by_chat[self.dialog.id])
self.save_last_dumped_message_id(self.dialog.id, messages[-1].id)
self.console_text_edit_2.append("Messages dumped successfully.")
except Exception as e:
self.console_text_edit_2.append(f"Error dumping messages: {str(e)}")
Anyone that can help or even provide any kind of assistance or if they are interested in working on the project with me, just let me know