Бот + прокси
This commit is contained in:
29
bot/__main__.py
Normal file
29
bot/__main__.py
Normal file
@@ -0,0 +1,29 @@
|
||||
import logging
|
||||
|
||||
import asyncio
|
||||
import sys
|
||||
|
||||
from bot.commands import router as command_router
|
||||
from bot.factory import bot, dp, init_bot_and_dp
|
||||
from config import config
|
||||
|
||||
logging.basicConfig(
|
||||
level=logging.INFO,
|
||||
format='%(asctime)s %(name)s:%(lineno)d %(levelname)s %(message)s',
|
||||
handlers=[
|
||||
logging.FileHandler('app.log', encoding='utf-8'),
|
||||
logging.StreamHandler(sys.stdout)
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
async def main():
|
||||
bot, dp = init_bot_and_dp(f"socks5://{config.PROXY_URL}", config.BOT_TOKEN)
|
||||
dp.include_router(command_router)
|
||||
await dp.start_polling(bot)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
asyncio.run(main())
|
||||
Reference in New Issue
Block a user