Skip to content

Commit

Permalink
Fix DC ID at startup
Browse files Browse the repository at this point in the history
  • Loading branch information
DeekshithSH and tulir committed Jul 20, 2024
1 parent 4b9bfcc commit 2fe55be
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions WebStreamer/bot/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,14 @@ def __init__(
proxy=None
)
)

async def startup(self):
config = await self(functions.help.GetConfigRequest())
for option in config.dc_options:
if option.ip_address == self.session.server_address:
if self.session.dc_id != option.id:
logging.warning(f"Fixed DC ID in session from {self.session.dc_id} to {option.id}")
self.session.set_dc(option.id, option.ip_address, option.port)
self.session.save()
break
# transfer.post_init()

0 comments on commit 2fe55be

Please sign in to comment.