コード例 #1
0
async def save_welcome(event):
    if event.fwd_from:
        return
    msg = await event.get_reply_message()
    string = "".join(event.text.split(maxsplit=1)[1:])
    msg_id = None
    if msg and msg.media and not string:
        if BOTLOG_CHATID:
            await bot.send_message(
                BOTLOG_CHATID,
                f"#WELCOME_NOTE\
                \nCHAT ID: {event.chat_id}\
                \nThe following message is saved as the welcome note for the {event.chat.title}, Don't delete this message !!",
            )
            msg_o = await event.client.forward_messages(
                entity=BOTLOG_CHATID, messages=msg, from_peer=event.chat_id, silent=True
            )
            msg_id = msg_o.id
        else:
            await edit_or_reply(
                event,
                "`↫ يتطلب حفظ الوسائط كجزء من ملاحظة الترحيب تعيين BOTLOG_CHATID ⪼`",
            )
            return
    elif event.reply_to_msg_id and not string:
        rep_msg = await event.get_reply_message()
        string = rep_msg.text
    success = "𖠕 تـم حفـض ترحـيبك بنـجاح @jthon ↫"
    if add_welcome_setting(event.chat_id, 0, string, msg_id) is True:
        return await edit_or_reply(event, success.format("saved"))
    rm_welcome_setting(event.chat_id)
    if add_welcome_setting(event.chat_id, 0, string, msg_id) is True:
        return await edit_or_reply(event, success.format("updated"))
    await edit_or_reply("Error while setting welcome in this group")
コード例 #2
0
ファイル: welcome.py プロジェクト: ajmalajoos/CatUserbot
async def save_welcome(event):
    msg = await event.get_reply_message()
    string = "".join(event.text.split(maxsplit=1)[1:])
    msg_id = None
    if msg and msg.media and not string:
        if BOTLOG_CHATID:
            await bot.send_message(
                BOTLOG_CHATID,
                f"#WELCOME_NOTE\
                \nCHAT ID: {event.chat_id}\
                \nThe following message is saved as the welcome note for the {event.chat.title}, Dont delete this message !!",
            )
            msg_o = await event.client.forward_messages(
                entity=BOTLOG_CHATID,
                messages=msg,
                from_peer=event.chat_id,
                silent=True)
            msg_id = msg_o.id
        else:
            await edit_or_reply(
                event,
                "`Saving media as part of the welcome note requires the BOTLOG_CHATID to be set.`",
            )
            return
    elif event.reply_to_msg_id and not string:
        rep_msg = await event.get_reply_message()
        string = rep_msg.text
    success = "`Welcome note {} for this chat.`"
    if add_welcome_setting(event.chat_id, 0, string, msg_id) is True:
        return await edit_or_reply(event, success.format("saved"))
    rm_welcome_setting(event.chat_id)
    if add_welcome_setting(event.chat_id, 0, string, msg_id) is True:
        return await edit_or_reply(event, success.format("updated"))
    await edit_or_reply("Error while setting welcome in this group")
コード例 #3
0
async def save_welcome(event):
    if event.fwd_from:
        return
    msg = await event.get_reply_message()
    string = "".join(event.text.split(maxsplit=1)[1:])
    msg_id = None
    if msg and msg.media and not string:
        if BOTLOG_CHATID:
            await bot.send_message(
                BOTLOG_CHATID,
                f"#الترحيب\
                \n ⪼ ايدي الدردشة: {event.chat_id}\
                \n ⪼ يتم حفظ الرسالة التالية كملاحظة ترحيب لـ {event.chat.title}, لا تحذف هذه الرسالة !!",
            )
            msg_o = await event.client.forward_messages(
                entity=BOTLOG_CHATID, messages=msg, from_peer=event.chat_id, silent=True
            )
            msg_id = msg_o.id
        else:
            await edit_or_reply(
                event,
                "**يتطلب حفظ الوسائط كجزء من الملاحظة الترحيبية تعيين BOTLOG_CHATID.**",
            )
            return
    elif event.reply_to_msg_id and not string:
        rep_msg = await event.get_reply_message()
        string = rep_msg.text
    success = "** ⪼ تم {} التـرحيب في هذه الدردشـه 𓆰، **"
    if add_welcome_setting(event.chat_id, 0, string, msg_id) is True:
        return await edit_or_reply(event, success.format("حفـظ"))
    rm_welcome_setting(event.chat_id)
    if add_welcome_setting(event.chat_id, 0, string, msg_id) is True:
        return await edit_or_reply(event, success.format("تحـديث"))
    await edit_or_reply("خطأ أثناء تعيين الترحيب في هذه المجموعة")
コード例 #4
0
ファイル: welcome.py プロジェクト: AtulGore8997/catuserbot
async def _(event):
    if event.fwd_from:
        return
    cws = get_current_welcome_settings(event.chat_id)
    rm_welcome_setting(event.chat_id)
    await edit_or_reply(event ,"Welcome note cleared. " + \
        "The previous welcome message was `{}`.".format(cws.custom_welcome_message))
コード例 #5
0
ファイル: welcome.py プロジェクト: BristolMyers/ExelonTest
async def _(event):
    if event.fwd_from:
        return
    cws = get_current_welcome_settings(event.chat_id)
    rm_welcome_setting(event.chat_id)
    await edit_or_reply(event, " Hoşgeldin mesajı silindi. " +
                        "En son belirlenen hoşgeldin mesajı : `{}`.".format(cws.custom_welcome_message))
コード例 #6
0
async def _(event):
    if event.fwd_from:
        return
    cws = get_current_welcome_settings(event.chat_id)
    rm_welcome_setting(event.chat_id)
    await event.edit(
        "**⌔︙تم حذف ترحيب بنجاح ✅**" + \
        "**⌔︙رساله الترحيب السابقه هيه ↪️** `{}`.".format(cws.custom_welcome_message)
    )
コード例 #7
0
async def _(event):
    if event.fwd_from:
        return
    cws = get_current_welcome_settings(event.chat_id)
    rm_welcome_setting(event.chat_id)
    await event.edit(
        "🗑️Messaggio di benvenuto, cancellato. " + \
        "Il vecchio messaggio di benvenuto era `{}`.".format(cws.custom_welcome_message)
    )
コード例 #8
0
ファイル: welcome.py プロジェクト: hussein2Me/Bot2Me
async def _(event):
    if event.fwd_from:
        return
    cws = get_current_welcome_settings(event.chat_id)
    rm_welcome_setting(event.chat_id)
    await event.edit(
        "تم محو ملاحظة الترحيب. " + \
        "كانت رسالة الترحيب السابقة `{}`.".format(cws.custom_welcome_message)
    )
コード例 #9
0
async def _(event):
    if event.fwd_from:
        return
    cws = get_current_welcome_settings(event.chat_id)
    rm_welcome_setting(event.chat_id)
    await event.edit(
        "-@iqthon تم حذف ترحيب. " + \
        "رساله الترحيب السابقه هيه `{}`.".format(cws.custom_welcome_message)
    )
コード例 #10
0
ファイル: welcome_IQ.py プロジェクト: TeleOniOn/telethon-iraq
async def _(event):
    if event.fwd_from:
        return
    cws = get_current_welcome_settings(event.chat_id)
    rm_welcome_setting(event.chat_id)
    await event.edit(
        "-  𖢞 Welcome cleared - @TeleOniOn. " + \
        "The previous welcome message was `{}`.".format(cws.custom_welcome_message)
    )
コード例 #11
0
async def _(event):
    if event.fwd_from:
        return
    cws = get_current_welcome_settings(event.chat_id)
    rm_welcome_setting(event.chat_id)
    await event.edit(
        "Welcome eliminato. " + \
        "The previous welcome message was `{}`.".format(cws.custom_welcome_message)
    )
コード例 #12
0
ファイル: welcome.py プロジェクト: thewhiteharlot/purple2cat
async def del_welcome(event):
    if event.fwd_from:
        return
    if rm_welcome_setting(event.chat_id) is True:
        await edit_or_reply(event, "`Welcome note deleted for this chat.`")
    else:
        await edit_or_reply(event, "`Do I have a welcome note here ?`")
コード例 #13
0
ファイル: sawe_AR.py プロジェクト: SADBRJA/SAD-IQ
async def del_welcome(event):
    if event.fwd_from:
        return
    if rm_welcome_setting(event.chat_id) is True:
        await edit_or_reply(event, "**تم مسح الترحيب بنجاح ✅**")
    else:
        await edit_or_reply(event, "**لا يوجد ترحيب مضاف هنا**")
コード例 #14
0
async def del_welcome(event):
    if event.fwd_from:
        return
    if rm_welcome_setting(event.chat_id) is True:
        await edit_or_reply(event, "𖠕 تـم مـسح ترحـيبك بنـجاح ↫`")
    else:
        await edit_or_reply(event, "𖠕  لايـوجد لديـك هـنا تـرحيب ↫")
コード例 #15
0
async def del_welcome(event):
    if event.fwd_from:
        return
    if rm_welcome_setting(event.chat_id) is True:
        await edit_or_reply(event, "**تــم حــذف الترحــيب**")
    else:
        await edit_or_reply(event, "**ليس هناك اي ترحــيب فـي الـدردشــة**")
コード例 #16
0
ファイル: welcome.py プロジェクト: Akarata/test
async def del_welcome(event):
    if event.fwd_from:
        return
    if rm_welcome_setting(event.chat_id) is True:
        await edit_or_reply(
            event, "`Catatan selamat datang dihapus untuk obrolan ini.`"
        )
    else:
        await edit_or_reply(event, "`Apakah saya punya pesan selamat datang di sini ?`")
コード例 #17
0
async def del_welcome(event):
    if event.fwd_from:
        return
    if rm_welcome_setting(event.chat_id) is True:
        await edit_or_reply(
            event,
            "** ⪼ تم حـذف الترحيب في هـذه الدردشـه 𓆰،**",
        )
    else:
        await edit_or_reply(
            event,
            "** ⪼ ليس هناك اي ترحــيب فـي الـدردشــة 𓆰،**",
        )