Update main.py
BOT_open_sesam/pipeline/head There was a failure building this commit
Details
BOT_open_sesam/pipeline/head There was a failure building this commit
Details
parent
253da9479c
commit
90527b029e
70
main.py
70
main.py
|
|
@ -1,35 +1,35 @@
|
||||||
import os
|
import os
|
||||||
import asyncio
|
import asyncio
|
||||||
import logging
|
import logging
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|
||||||
from aiogram import Bot, Dispatcher
|
from aiogram import Bot, Dispatcher
|
||||||
from aiogram.enums import ParseMode
|
from aiogram.enums import ParseMode
|
||||||
from aiogram.client.default import DefaultBotProperties
|
from aiogram.client.default import DefaultBotProperties
|
||||||
from aiogram.client.session.aiohttp import AiohttpSession
|
from aiogram.client.session.aiohttp import AiohttpSession
|
||||||
|
TELEGRAM_BOT_TOKEN
|
||||||
from handlers import register_all_handlers
|
from handlers import register_all_handlers
|
||||||
from config import config
|
from config import config
|
||||||
|
|
||||||
# BOT_TOKEN = config["BOT_TOKEN"]
|
# BOT_TOKEN = config["BOT_TOKEN"]
|
||||||
BOT_TOKEN=os.environ.get('BOT_TOKEN')
|
TELEGRAM_BOT_TOKEN=os.environ.get('BOT_TOKEN')
|
||||||
PROXY_URL = os.environ.get('PROXY_URL')
|
PROXY_URL = os.environ.get('PROXY_URL')
|
||||||
|
|
||||||
dp = Dispatcher()
|
dp = Dispatcher()
|
||||||
register_all_handlers(dp)
|
register_all_handlers(dp)
|
||||||
|
|
||||||
session = AiohttpSession(proxy=PROXY_URL)
|
session = AiohttpSession(proxy=PROXY_URL)
|
||||||
|
|
||||||
async def main() -> None:
|
async def main() -> None:
|
||||||
bot = Bot(
|
bot = Bot(
|
||||||
token=BOT_TOKEN
|
token=BOT_TOKEN
|
||||||
, session=session
|
, session=session
|
||||||
, default=DefaultBotProperties(parse_mode=ParseMode.HTML)
|
, default=DefaultBotProperties(parse_mode=ParseMode.HTML)
|
||||||
)
|
)
|
||||||
await dp.start_polling(bot)
|
await dp.start_polling(bot)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
logging.basicConfig(level=logging.INFO, stream=sys.stdout)
|
logging.basicConfig(level=logging.INFO, stream=sys.stdout)
|
||||||
asyncio.run(main())
|
asyncio.run(main())
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue