コード例 #1
0
ファイル: notes.py プロジェクト: srgudhka/subot2
async def incom_note(getnt):
    """ Notes logic. """
    try:
        if not (await getnt.get_sender()).bot:
            try:
                from userbot.modules.sql_helper.notes_sql import get_notes
            except AttributeError:
                return
            notename = getnt.text[1:]
            notes = get_notes(getnt.chat_id)
            for note in notes:
                if notename == note.keyword:
                    if note.snip_type == TYPE_PHOTO:
                        media = types.InputPhoto(int(note.media_id),
                                                 int(note.media_access_hash),
                                                 note.media_file_reference)
                    elif note.snip_type == TYPE_DOCUMENT:
                        media = types.InputDocument(
                            int(note.media_id), int(note.media_access_hash),
                            note.media_file_reference)
                    else:
                        media = None
                    message_id = getnt.message.id
                    if getnt.reply_to_msg_id:
                        message_id = getnt.reply_to_msg_id
                    await getnt.client.send_message(getnt.chat_id,
                                                    note.reply,
                                                    reply_to=message_id,
                                                    file=media)
    except AttributeError:
        pass
コード例 #2
0
async def incom_note(e):
    if not (await e.get_sender()).bot:
        from userbot.modules.sql_helper.notes_sql import get_notes
        listes = e.text[1:]
        E = get_notes(e.chat_id)
        for t in E:
            if listes == t.keyword:
                await e.reply(t.reply)
                return
コード例 #3
0
async def notes_active(e):
    if not e.text[0].isalpha() and e.text[0] != "!" and e.text[
            0] != "/" and e.text[0] != "#" and e.text[0] != "@":
        from userbot.modules.sql_helper.notes_sql import get_notes
        transact = "Messages saved in this chat: \n\n"
        E = get_notes(e.chat_id)
        for i in E:
            transact = transact + "🔹 " + i.keyword + "\n"
        await e.edit(transact)
コード例 #4
0
ファイル: notes.py プロジェクト: mrismanaziz/Man-Userbot
async def notes_active(svd):
    try:
        from userbot.modules.sql_helper.notes_sql import get_notes
    except AttributeError:
        return await svd.edit("**Running on Non-SQL mode!**")
    message = "**Tidak ada catatan yang disimpan dalam obrolan ini**"
    notes = get_notes(svd.chat_id)
    for note in notes:
        if message == "**Tidak ada catatan yang disimpan dalam obrolan ini**":
            message = "**Catatan yang disimpan dalam obrolan ini:**\n"
        message += "`#{}`\n".format(note.keyword)
    await svd.edit(message)
コード例 #5
0
async def notes_active(svd):
    try:
        from userbot.modules.sql_helper.notes_sql import get_notes
    except AttributeError:
        return await svd.edit("`Running on Non-SQL mode!`")
    message = "`There are no saved notes in this chat`"
    notes = get_notes(svd.chat_id)
    for note in notes:
        if message == "`There are no saved notes in this chat`":
            message = "Notes saved in this chat:\n"
        message += "`#{}`\n".format(note.keyword)
    await svd.edit(message)
コード例 #6
0
ファイル: notes.py プロジェクト: zhxtrybuild/KensurBot
async def notes_active(svd):
    """For .notes command, list all of the notes saved in a chat."""
    try:
        from userbot.modules.sql_helper.notes_sql import get_notes
    except AttributeError:
        return await svd.edit("**Running on Non-SQL mode!**")
    message = "**There are no saved notes in this chat**"
    notes = get_notes(svd.chat_id)
    for note in notes:
        if message == "**There are no saved notes in this chat**":
            message = "Notes saved in this chat:\n"
        message += f"`#{note.keyword}`\n"
    await svd.edit(message)
コード例 #7
0
ファイル: notes.py プロジェクト: gplinaja/PurpleBot
async def notes_active(svd):
    """ For .notes command, list all of the notes saved in a chat. """
    try:
        from userbot.modules.sql_helper.notes_sql import get_notes
    except AttributeError:
        return await svd.edit("**Executando em modo não SQL!**")
    message = "**Não há notas salvas neste bate-papo**"
    notes = get_notes(svd.chat_id)
    for note in notes:
        if message == "**Não há notas salvas neste bate-papo**":
            message = "Notas salvas neste bate-papo:\n"
        message += f"`#{note.keyword}`\n"
    await svd.edit(message)
コード例 #8
0
async def notes_active(svd):
    try:
        from userbot.modules.sql_helper.notes_sql import get_notes
    except AttributeError:
        await svd.edit("`Bot qeyri-SQL rejimində işləyir!!`")
        return
    message = LANG['NOT_FOUND']
    notes = get_notes(svd.chat_id)
    for note in notes:
        if message == LANG['NOT_FOUND']:
            message = f"{LANG['NOTES']}:\n"
            message += "`#{}`\n".format(note.keyword)
        else:
            message += "`#{}`\n".format(note.keyword)
    await svd.edit(message)
コード例 #9
0
ファイル: notes.py プロジェクト: bronx121/bironx1
async def notes_active(svd):
    if not svd.text[0].isalpha() and svd.text[0] not in ("/", "#", "@", "!"):
        try:
            from userbot.modules.sql_helper.notes_sql import get_notes
        except:
            await svd.edit("`Running on Non-SQL mode!`")
            return

        notes = get_notes(svd.chat_id)
        message = '`There are no saved notes in this chat`'
        if notes:
            message = "Messages saved in this chat: \n\n"
            for note in notes:
                message = message + "🔹 " + note.keyword + "\n"
        await svd.edit(message)
コード例 #10
0
ファイル: notes.py プロジェクト: bronx121/bironx1
async def incom_note(getnt):
    try:
        if not (await getnt.get_sender()).bot:
            try:
                from userbot.modules.sql_helper.notes_sql import get_notes
            except:
                return
            notename = getnt.text[1:]
            notes = get_notes(getnt.chat_id)
            for note in notes:
                if notename == note.keyword:
                    await getnt.reply(note.reply)
                    return
    except:
        pass
コード例 #11
0
ファイル: notes.py プロジェクト: mmvvip/MARSHAL-MATHERS-BOT
async def notes_active(svd):
    """ For .saved command, list all of the notes saved in a chat. """
    if not svd.text[0].isalpha() and svd.text[0] not in ("/", "#", "@", "!"):
        try:
            from userbot.modules.sql_helper.notes_sql import get_notes
        except AttributeError:
            await svd.edit("`Running on Non-SQL mode!`")
            return
        notes = get_notes(svd.chat_id)
        message = '`There are no saved notes in this chat.`'
        if notes:
            message = "Notes saved in this chat: \n\n"
            for note in notes:
                message = message + "🔹 " + note.keyword + "\n"
        await svd.edit(message)
コード例 #12
0
async def notes_active(svd):
    """ For .notes command, list all of the notes saved in a chat. """
    try:
        from userbot.modules.sql_helper.notes_sql import get_notes
    except AttributeError:
        return await svd.edit("`Running on Non-SQL mode!`")
    message = "`Tidak ada catatan mantan disimpan disini`"
    notes = get_notes(svd.chat_id)
    for note in notes:
        if message == "`Tidak ada catatan mantan`":
            message = "Notes saved in this chat:\n"
            message += "`#{}`\n".format(note.keyword)
        else:
            message += "`#{}`\n".format(note.keyword)
    await svd.edit(message)
コード例 #13
0
ファイル: notes.py プロジェクト: yuda1211/Yud-Userbot
async def notes_active(svd):
    """ For .notes command, list all of the notes saved in a chat. """
    try:
        from userbot.modules.sql_helper.notes_sql import get_notes
    except AttributeError:
        return await svd.edit("`Berjalan pada mode Non-SQL!`")
    message = "`There are no saved notes in this chat`"
    notes = get_notes(svd.chat_id)
    for note in notes:
        if message == "`There are no saved notes in this chat`":
            message = "Notes saved in this chat:\n"
            message += "`#{}`\n".format(note.keyword)
        else:
            message += "`#{}`\n".format(note.keyword)
    await svd.edit(message)
コード例 #14
0
async def notes_active(svd):
    """ For .notes command, list all of the notes saved in a chat. """
    try:
        from userbot.modules.sql_helper.notes_sql import get_notes
    except AttributeError:
        return await svd.edit("`Berjalan di mode Non-SQL!`")
    message = "`Tidak ada catatan yang disimpan dalam obrolan ini`"
    notes = get_notes(svd.chat_id)
    for note in notes:
        if message == "`Tidak ada catatan yang disimpan dalam obrolan ini`":
            message = "**Catatan yang disimpan dalam obrolan ini** \n"
            message += "`#{}`\n".format(note.keyword)
        else:
            message += "`#{}`\n".format(note.keyword)
    await svd.edit(message)
コード例 #15
0
async def notes_active(svd):
    """ For .notes command, list all of the notes saved in a chat. """
    try:
        from userbot.modules.sql_helper.notes_sql import get_notes
    except AttributeError:
        await svd.edit("`Running on Non-SQL mode!`")
        return
    message = "`There are no saved notes in this chat`"
    notes = get_notes(svd.chat_id)
    for note in notes:
        if message == "`Ei Chat e Kono Note Saved Naai`":
            message = "Saved Kora Notegulo holo:\n"
            message += "`#{}`\n".format(note.keyword)
        else:
            message += "`#{}`\n".format(note.keyword)
    await svd.edit(message)
コード例 #16
0
ファイル: notes.py プロジェクト: FrukanN/UnusUserBot
async def notes_active(svd):
    """ .notes komutu sohbette kaydedilmiş tüm notları listeler. """
    try:
        from userbot.modules.sql_helper.notes_sql import get_notes
    except AttributeError:
        await svd.edit("`Bot Non-SQL modunda çalışıyor!!`")
        return
    message = LANG['NOT_FOUND']
    notes = get_notes(svd.chat_id)
    for note in notes:
        if message == LANG['NOT_FOUND']:
            message = f"{LANG['NOTES']}:\n"
            message += "`#{}`\n".format(note.keyword)
        else:
            message += "`#{}`\n".format(note.keyword)
    await svd.edit(message)
コード例 #17
0
async def notes_active(svd):
    """ For .notes command, list all of the notes saved in a chat. """
    try:
        from userbot.modules.sql_helper.notes_sql import get_notes
    except AttributeError:
        await svd.edit("`Executando em modo não-SQL!`")
        return
    message = "`Não há notas salvas neste bate-papo`"
    notes = get_notes(svd.chat_id)
    for note in notes:
        if message == "`Não há notas salvas neste bate-papo`":
            message = "Notas salvas neste chat:\n"
            message += "`#{}`\n".format(note.keyword)
        else:
            message += "`#{}`\n".format(note.keyword)
    await svd.edit(message)
コード例 #18
0
async def notes_active(svd):
    """ For .notes command, list all of the notes saved in a chat. """
    try:
        from userbot.modules.sql_helper.notes_sql import get_notes
    except AttributeError:
        await svd.edit("Non-SQL mode ON!")
        return
    message = "No notes in this chat"
    notes = get_notes(svd.chat_id)
    for note in notes:
        if message == "No notes in this chat":
            message = "Notes saved in this chat:\n"
            message += "#{}\n".format(note.keyword)
        else:
            message += "#{}\n".format(note.keyword)
    await svd.edit(message)
コード例 #19
0
ファイル: notes.py プロジェクト: xfl4me/Userbot
async def notes_active(svd):
    """ For .notes command, list all of the notes saved in a chat. """
    try:
        from userbot.modules.sql_helper.notes_sql import get_notes
    except AttributeError:
        await svd.edit("`Running on Non-SQL mode!`")
        return
    message = "`Non ci sono note salvate qui!`"
    notes = get_notes(svd.chat_id)
    for note in notes:
        if message == "`Non ci sono note salvate qui!`":
            message = "Note salvate qui:\n"
            message += "`#{}`\n".format(note.keyword)
        else:
            message += "`#{}`\n".format(note.keyword)
    await svd.edit(message)
コード例 #20
0
ファイル: notes.py プロジェクト: qlmyste/Telegram-UserBot
async def notes_active(svd):
    """ For .notes command, list all of the notes saved in a chat. """
    if environ.get("isSuspended") == "True":
        return
    try:
        from userbot.modules.sql_helper.notes_sql import get_notes
    except AttributeError:
        await svd.edit("`Running on Non-SQL mode!`")
        return
    message = "`There are no saved notes in this chat`"
    notes = get_notes(svd.chat_id)
    for note in notes:
        if message == "`There are no saved notes in this chat`":
            message = "Notes saved in this chat:\n"
            message += "`#{}`\n".format(note.keyword)
        else:
            message += "`#{}`\n".format(note.keyword)
    await svd.edit(message)
コード例 #21
0
async def notes_active(svd):
    """ For .saved command, list all of the notes saved in a chat. """
    if not svd.text[0].isalpha() and svd.text[0] not in ("/", "#", "@", "!"):
        try:
            from userbot.modules.sql_helper.notes_sql import get_notes
        except AttributeError:
            await svd.edit("`Running on Non-SQL mode!`")
            return

        message = "`There are no saved notes in this chat`"
        notes = get_notes(svd.chat_id)
        for note in notes:
            if message == "`There are no saved notes in this chat`":
                message = "Notes saved in this chat:\n"
                message += "🗒️ `{}`\n".format(note.keyword)
            else:
                message += "🗒️ `{}`\n".format(note.keyword)

        await svd.edit(message)