Skip to content

Commit

Permalink
Add koyeb support
Browse files Browse the repository at this point in the history
  • Loading branch information
Devil-Botz authored Dec 5, 2022
1 parent ec4dfaa commit 930f1e3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@
from pyrogram.raw.all import layer
from database.ia_filterdb import Media
from database.users_chats_db import db
from info import SESSION, API_ID, API_HASH, BOT_TOKEN, LOG_STR, LOG_CHANNEL
from info import SESSION, API_ID, API_HASH, BOT_TOKEN, LOG_STR, LOG_CHANNEL, PORT
from utils import temp
from typing import Union, Optional, AsyncGenerator
from pyrogram import types
from Script import script
from datetime import date, datetime
import pytz
from aiohttp import web
from plugins import web_server

class Bot(Client):

Expand Down Expand Up @@ -51,6 +53,10 @@ async def start(self):
now = datetime.now(tz)
time = now.strftime("%H:%M:%S %p")
await self.send_message(chat_id=LOG_CHANNEL, text=script.RESTART_TXT.format(today, time))
app = web.AppRunner(await web_server())
await app.setup()
bind_address = "0.0.0.0"
await web.TCPSite(app, bind_address, PORT).start()

async def stop(self, *args):
await super().stop()
Expand Down

0 comments on commit 930f1e3

Please sign in to comment.