示例#1
0
async def profanity(event):
    if event.fwd_from:
        return
    if event.is_private:
        return
    input = event.pattern_match.group(2)
    if not event.sender_id == OWNER_ID:
        if not await is_register_admin(event.input_chat, event.sender_id):
            await event.reply("Only admins can execute this command!")
            return
        else:
            if not await can_change_info(message=dmod):
                await event.reply(
                    "You are missing the following rights to use this command:CanChangeinfo"
                )
                return
    if not input:
        if is_nightmode_indb(str(event.chat_id)):
            await event.reply("Currently NightMode is Enabled for this Chat")
            return
        await event.reply("Currently NightMode is Disabled for this Chat")
        return
    if "on" in input:
        if event.is_group:
            if is_nightmode_indb(str(event.chat_id)):
                await event.reply(
                    "Night Mode is Already Turned ON for this Chat")
                return
            add_nightmode(str(event.chat_id))
            await event.reply("NightMode turned on for this chat.")
    if "off" in input:
        if event.is_group:
            if not is_nightmode_indb(str(event.chat_id)):
                await event.reply("Night Mode is Already Off for this Chat")
                return
        rmnightmode(str(event.chat_id))
        await event.reply("NightMode Disabled!")
    if not "off" in input and not "on" in input:
        await event.reply("Please Specify On or Off!")
        return
示例#2
0
async def disable_ws(event):
    if event.is_group:
     if not (await is_register_admin(event.input_chat, event.message.sender_id)):
       await event.reply("⚠️Hai.. You are not admin..You can't use this command..")
       return

    if not event.is_group:
        await event.reply("You Can Only Disable Night Mode in Groups.")
        return
    if not is_nightmode_indb(str(event.chat_id)):
        await event.reply("This Chat is Has Not Enabled Night Mode.")
        return
    rmnightmode(str(event.chat_id))
    await event.reply(f"Removed Chat {event.chat.title} With Id {event.chat_id} From Database.")
示例#3
0
async def close_ws(event):
    if event.is_group:
     if not (await is_register_admin(event.input_chat, event.message.sender_id)):
       await event.reply("⚠️Hai.. You are not admin..You can't use this command..")
       return

    if not event.is_group:
        await event.reply("You Can Only Enable Night Mode in Groups.")
        return
    if is_nightmode_indb(str(event.chat_id)):
        await event.reply("This Chat is Has Already Enabled Night Mode.")
        return
    add_nightmode(str(event.chat_id))
    await event.reply(f"Added Chat {event.chat.title} With Id {event.chat_id} To Database. **This Group Will Be Closed On 12Am(IST) And Will Opened On 06Am(IST)**")