mirror of
https://github.com/avipatilpro/FileStreamBot.git
synced 2026-01-15 22:32:53 -03:00
push
This commit is contained in:
21
WebStreamer/bot/plugins/start.py
Normal file
21
WebStreamer/bot/plugins/start.py
Normal file
@@ -0,0 +1,21 @@
|
||||
# This file is a part of TG-FileStreamBot
|
||||
# Coding : Jyothis Jayanth [@EverythingSuckz]
|
||||
|
||||
from WebStreamer.bot import StreamBot
|
||||
from WebStreamer.vars import Var
|
||||
from pyrogram import filters, emoji
|
||||
from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton
|
||||
|
||||
@StreamBot.on_message(filters.command(['start', 'help']))
|
||||
async def start(b, m):
|
||||
await m.reply('Hi, Send me a file to get an instant stream link.',
|
||||
reply_markup=InlineKeyboardMarkup(
|
||||
[
|
||||
[
|
||||
InlineKeyboardButton(
|
||||
f'{emoji.STAR} Source {emoji.STAR}',
|
||||
url='https://github.com/EverythingSuckz/TG-FileStreamBot'
|
||||
)
|
||||
]
|
||||
]
|
||||
))
|
||||
19
WebStreamer/bot/plugins/stream.py
Normal file
19
WebStreamer/bot/plugins/stream.py
Normal file
@@ -0,0 +1,19 @@
|
||||
# This file is a part of TG-FileStreamBot
|
||||
# Coding : Jyothis Jayanth [@EverythingSuckz]
|
||||
|
||||
from WebStreamer.bot import StreamBot
|
||||
from WebStreamer.vars import Var
|
||||
from pyrogram import filters, Client, emoji
|
||||
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 \
|
||||
"http://{}:{}/{}".format(Var.FQDN,
|
||||
Var.PORT,
|
||||
log_msg.message_id)
|
||||
await m.reply_text(
|
||||
text="`{}`".format(stream_link)
|
||||
)
|
||||
Reference in New Issue
Block a user