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 asyncio
|
||||
import logging
|
||||
import sys
|
||||
|
||||
|
||||
from aiogram import Bot, Dispatcher
|
||||
from aiogram.enums import ParseMode
|
||||
from aiogram.client.default import DefaultBotProperties
|
||||
from aiogram.client.session.aiohttp import AiohttpSession
|
||||
|
||||
from handlers import register_all_handlers
|
||||
from config import config
|
||||
|
||||
# BOT_TOKEN = config["BOT_TOKEN"]
|
||||
BOT_TOKEN=os.environ.get('BOT_TOKEN')
|
||||
PROXY_URL = os.environ.get('PROXY_URL')
|
||||
|
||||
dp = Dispatcher()
|
||||
register_all_handlers(dp)
|
||||
|
||||
session = AiohttpSession(proxy=PROXY_URL)
|
||||
|
||||
async def main() -> None:
|
||||
bot = Bot(
|
||||
token=BOT_TOKEN
|
||||
, session=session
|
||||
, default=DefaultBotProperties(parse_mode=ParseMode.HTML)
|
||||
)
|
||||
await dp.start_polling(bot)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
logging.basicConfig(level=logging.INFO, stream=sys.stdout)
|
||||
asyncio.run(main())
|
||||
import os
|
||||
import asyncio
|
||||
import logging
|
||||
import sys
|
||||
|
||||
|
||||
from aiogram import Bot, Dispatcher
|
||||
from aiogram.enums import ParseMode
|
||||
from aiogram.client.default import DefaultBotProperties
|
||||
from aiogram.client.session.aiohttp import AiohttpSession
|
||||
TELEGRAM_BOT_TOKEN
|
||||
from handlers import register_all_handlers
|
||||
from config import config
|
||||
|
||||
# BOT_TOKEN = config["BOT_TOKEN"]
|
||||
TELEGRAM_BOT_TOKEN=os.environ.get('BOT_TOKEN')
|
||||
PROXY_URL = os.environ.get('PROXY_URL')
|
||||
|
||||
dp = Dispatcher()
|
||||
register_all_handlers(dp)
|
||||
|
||||
session = AiohttpSession(proxy=PROXY_URL)
|
||||
|
||||
async def main() -> None:
|
||||
bot = Bot(
|
||||
token=BOT_TOKEN
|
||||
, session=session
|
||||
, default=DefaultBotProperties(parse_mode=ParseMode.HTML)
|
||||
)
|
||||
await dp.start_polling(bot)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
logging.basicConfig(level=logging.INFO, stream=sys.stdout)
|
||||
asyncio.run(main())
|
||||
|
|
|
|||
Loading…
Reference in New Issue