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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid auth in sending 6 to 9 requests #5

Open
poyap opened this issue Sep 12, 2023 · 1 comment
Open

Invalid auth in sending 6 to 9 requests #5

poyap opened this issue Sep 12, 2023 · 1 comment

Comments

@poyap
Copy link

poyap commented Sep 12, 2023

میخوام پیام‌های کانال‌هایی که عضو هستم رو دریافت کنم ولی بعد از چند ریکوئست ارور زیر رو میده و اکسپشن InvalidAuth رو میده:
exception:
{'status': 'ERROR_GENERIC', 'status_det': 'INVALID_AUTH'}

بخشی از کد:

async with Client(session='rubpy') as client:
                    chats = await client.get_chats()
                    channels_info = {}
                    filtered_channels = [chat for chat in chats['chats'] if chat['abs_object']['type'] in ['Group', 'Channel']]
                    random.shuffle(filtered_channels)
                    for _ in range(50):
                        for channel in filtered_channels:
                            if not channels_info.get(channel['object_guid']):

                                channels_info[channel['object_guid']] = {
                                    'title' : channel['abs_object']['title'],
                                    'last_message_id' : channel['last_message_id'],
                                    'message_ids': [channel['last_message_id']]
                                }
                            else:
                                channels_info[channel['object_guid']]['last_message_id'] = channel['last_message_id']
                                if channel['last_message_id'] not in channels_info[channel['object_guid']]['message_ids']:
                                    channels_info[channel['object_guid']]['message_ids'].append(channel['last_message_id'])

                            messages = await client.get_messages(
                                channel['object_guid'], 
                                min_id=channels_info[channel['object_guid']]['message_ids'][0], 
                                max_id=channels_info[channel['object_guid']]['message_ids'][-1], 
                                limit=20)```
@shayanheidari01
Copy link
Owner

سلام کدوم متد این خطا رو میده؟
این خطا یعنی عدم دسترسی

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants