Beispiel #1
0
def stream(client, message):
    if player.STATE in (State.Playing, State.Paused):
        message.reply_text(
            _("stream_3")
        )
    else:
        args = message.text.split()

        if len(args) == 1:
            message.reply_text(
                _("stream_1")
            )
        elif len(args) != 2:
            message.reply_text(
                _("stream_2")
            )
        else:
            player.stream(
                args[1],
                func(
                    client.send_message,
                    LOG_GROUP,
                    _("group_2").format(
                        args[1]
                    )
                ) if LOG_GROUP else None
            )

            message.reply_text(
                _("stream_4")
            )
Beispiel #2
0
async def stream(client, message):
    if player.STATE in (State.Playing, State.Paused):
        m = await message.reply_text(_("stream_3"))
    else:
        args = message.text.split()

        if len(args) == 1:
            m = await message.reply_text(_("stream_1"))
        elif len(args) != 2:
            m = await message.reply_text(_("stream_2"))
        else:
            player.stream(args[1], [
                client.send_message, [LOG_GROUP,
                                      _("group_2").format(args[1])]
            ] if LOG_GROUP else None)

            await message.reply_text(_("stream_4"))

    if m and message.chat.type != "private":
        await sleep(5)
        await m.delete()

        try:
            await message.delete()
        except:
            pass
Beispiel #3
0
async def stream(client, message):
    if player.current:
        await message.reply_text(
            _("cant_stream")
        )
    else:
        args = message.text.split()

        if len(args) == 1:
            await message.reply_text(
                _("url_arg")
            )
        elif len(args) != 2:
            await message.reply_text(
                _("more_than_one_args")
            )
        else:
            stream = player.stream(
                args[1],
                [
                    client.send_message,
                    [
                        LOG_GROUP,
                        _("group_log_stream").format(
                            args[1]
                        )
                    ]
                ] if LOG_GROUP else None
            )

            await message.reply_text(
                _("streaming")
            )