mirror of
https://github.com/avipatilpro/FileStreamBot.git
synced 2026-01-15 22:32:53 -03:00
Fixed Heroku NoneType error + Added NO_PORT
This commit is contained in:
@@ -10,10 +10,11 @@ from pyrogram.types import Message, InlineKeyboardMarkup, InlineKeyboardButton
|
||||
@StreamBot.on_message(filters.private & (filters.document | filters.video | filters.audio), group=4)
|
||||
async def media_receive_handler(c: Client, m: Message):
|
||||
log_msg = await m.copy(chat_id=Var.BIN_CHANNEL)
|
||||
stream_link = "https://{}/{}".format(Var.FQDN, log_msg.message_id) if Var.ON_HEROKU else \
|
||||
stream_link = "https://{}/{}".format(Var.FQDN, log_msg.message_id) if Var.ON_HEROKU or Var.NO_PORT else \
|
||||
"http://{}:{}/{}".format(Var.FQDN,
|
||||
Var.PORT,
|
||||
log_msg.message_id)
|
||||
await m.reply_text(
|
||||
text="`{}`".format(stream_link)
|
||||
text="`{}`".format(stream_link),
|
||||
quote=True
|
||||
)
|
||||
@@ -15,7 +15,8 @@ class Var(object):
|
||||
BIN_CHANNEL = int(getenv('BIN_CHANNEL', None))
|
||||
PORT = int(getenv('PORT', 8080))
|
||||
BIND_ADRESS = str(getenv('WEB_SERVER_BIND_ADDRESS', '0.0.0.0'))
|
||||
OWNER_ID = int(getenv('OWNER_ID', None)) #TODO
|
||||
OWNER_ID = int(getenv('OWNER_ID')) #TODO
|
||||
NO_PORT = bool(getenv('NO_PORT', False))
|
||||
if 'DYNO' in environ:
|
||||
ON_HEROKU = True
|
||||
APP_NAME = str(getenv('APP_NAME'))
|
||||
|
||||
Reference in New Issue
Block a user