mirror of
https://github.com/nexus-stc/hyperboria
synced 2024-12-23 10:07:46 +01:00
- feat(nexus): Fixes for build - part 2
1 internal commit(s) GitOrigin-RevId: 3f788341d9250a6e5dae71a59763a71d1c7389a1
This commit is contained in:
parent
488ea3997f
commit
2967e66ef2
@ -1,5 +1,9 @@
|
||||
import datetime
|
||||
import logging
|
||||
from typing import (
|
||||
Optional,
|
||||
Union,
|
||||
)
|
||||
|
||||
from aiokit import AioThing
|
||||
from izihawa_utils.random import random_string
|
||||
@ -19,8 +23,20 @@ from .session_backend import AlchemySessionContainer
|
||||
|
||||
|
||||
class BaseTelegramClient(AioThing):
|
||||
def __init__(self, app_id, app_hash, database, bot_token=None, mtproxy=None, flood_sleep_threshold: int = 60):
|
||||
AioThing.__init__(self)
|
||||
def __init__(
|
||||
self,
|
||||
app_id: Union[int, str],
|
||||
app_hash: str,
|
||||
database: dict,
|
||||
bot_token: Optional[str] = None,
|
||||
mtproxy: Optional[dict] = None,
|
||||
flood_sleep_threshold: int = 60,
|
||||
):
|
||||
super().__init__()
|
||||
if not app_id or not app_hash:
|
||||
raise ValueError(
|
||||
'Your API ID or Hash cannot be empty or None. Set up telegram.app_id and/or telegram.app_hash'
|
||||
)
|
||||
self._telegram_client = TelegramClient(
|
||||
self._get_session(database),
|
||||
app_id,
|
||||
|
@ -1,6 +1,7 @@
|
||||
---
|
||||
|
||||
application:
|
||||
debug: true
|
||||
# Enable special Postgres `sharience` table to retrieve user-sent files
|
||||
is_sharience_enabled: true
|
||||
# URL to the picture shown while maintenance
|
||||
|
Loading…
Reference in New Issue
Block a user