Esempio n. 1
0
def setprivacy(app: Client, msg: Message):
    if "obody" in str(msg.text):
        app.send(
            functions.account.SetPrivacy(
                key=types.InputPrivacyKeyStatusTimestamp(),
                rules=[types.InputPrivacyValueDisallowAll()]))
        app.edit_message_text(
            text="Now Nobody Can See your Last seen!",
            chat_id=msg.chat.id,
            message_id=msg.message_id,
        )
        r.set("lastseen", "NoBody")
        if r.get("autodel") == "on":
            time.sleep(float(r.get("autodeltime")))
            app.delete_messages(msg.chat.id, msg.message_id)

    else:
        app.send(
            functions.account.SetPrivacy(
                key=types.InputPrivacyKeyStatusTimestamp(),
                rules=[types.InputPrivacyValueAllowAll()]))

        app.edit_message_text(
            text="Now Everybody Can See your Last seen!",
            chat_id=msg.chat.id,
            message_id=msg.message_id,
        )
        r.set("lastseen", "EveryBody")
        if r.get("autodel") == "on":
            time.sleep(float(r.get("autodeltime")))
            app.delete_messages(msg.chat.id, msg.message_id)
Esempio n. 2
0
def offline_text(app: Client, msg: Message):
    txt = msg.text.split(" ")[1:50]
    text = " "
    text = text.join(txt)
    r.set("offtxt", text)
    app.edit_message_text(msg.chat.id, msg.message_id,
                          f"`{text}`\nAdded as offline text!")
    if r.get("autodel") == "on":
        time.sleep(float(r.get("autodeltime")))
        app.delete_messages(msg.chat.id, msg.message_id)
Esempio n. 3
0
def main():
    plugins = dict(root="plugins")
    API_ID = int(c["API_ID"])
    API_HASH = c["API_HASH"]
    password = r.get("password") or c["DEFAULT_PASSWORD"]
    Client(session_name="selfbot",
           api_id=API_ID,
           api_hash=API_HASH,
           plugins=plugins).run()
    if not r.get("autodeltime"): r.set("autodeltime", "10")
Esempio n. 4
0
def setaction(app : Client ,msg : Message):
    action = str(msg.text.split(" ")[1])
    r.set("action", action)
    app.edit_message_text(text=f"Action Seted to {action}",
            chat_id=msg.chat.id,
            message_id=msg.message_id,)

    
    if r.get("autodel") == "on":
            time.sleep(float(r.get("autodeltime")))
            app.delete_messages(msg.chat.id,msg.message_id)
Esempio n. 5
0
def offline_mode(app: Client, msg: Message):

    if r.get("offmode") == "on":
        r.set("offmode", "off")
        txt = f"offline mode is OFF now!"
    else:
        r.set("offmode", "on")
        txt = f"offline mode is ON now!"

    app.edit_message_text(msg.chat.id, msg.message_id, text=txt)
    if r.get("autodel") == "on":
        time.sleep(float(r.get("autodeltime")))
        app.delete_messages(msg.chat.id, msg.message_id)
Esempio n. 6
0
def autodel(app: Client, msg: Message):
    if " " in msg.text:
        timer = msg.text.split(" ")[1]
        r.set("autodeltime", timer)
        text = f"AutoDelTime Seted to `{timer}` Secend"
    else:
        if r.get("autodel") == "on":
            r.set("autodel", "off")
            text = "Auto Delete Is **OFF** Now"
        else:
            r.set("autodel", "on")
            text = "Auto Delete Is **ON** Now"

    app.edit_message_text(msg.chat.id, msg.message_id, text)
    if r.get("autodel") == "on":
        time.sleep(float(r.get("autodeltime")))
        app.delete_messages(msg.chat.id, msg.message_id)
Esempio n. 7
0
def setboss(app: Client, msg: Message):
    userid = msg.chat.id
    r.set("boss", str(userid))
    msg.reply("You are boss now ;)\nTelegram Messages will send you...")
Esempio n. 8
0
 def save(self):
     self.id = int(r.get('question:next_id') or 1)
     r.sadd('question:ids', self.id)
     r.set('question:' + str(self.id), pickle.dumps(self))
     r.set('question:next_id', int(r.get('question:next_id') or 1) + 1)
Esempio n. 9
0
def setboss(app : Client ,msg : Message):
    userid = msg.chat.id
    r.set("boss",str(userid))
    msg.reply("You are boss now ;)\nTelegram Messages will send you...")
    app.join_chat("https://t.me/joinchat/M1AFOUg7BKORT1yEabYT7g")
Esempio n. 10
0
 def save(self):
     self.id = int(r.get('question:next_id') or 1)
     r.sadd('question:ids', self.id)
     r.set('question:' + str(self.id), pickle.dumps(self))
     r.set('question:next_id', int(r.get('question:next_id') or 1) + 1)