A
A
Andriy4262021-07-22 21:10:12
Python
Andriy426, 2021-07-22 21:10:12

How to fix user bot error?

Error in code

Pyrogram v1.1.13, Copyright (C) 2017-2021 Dan <https://github.com/delivrance>
Licensed under the terms of the GNU Lesser General Public License v3 or later (LGPLv3+)


The code itself
from pyrogram import Client, filters
from pyrogram.errors import FloodWait
 
from pyrogram.types import ChatPermissions
 
import time
from time import sleep
import random
 
app = Client("my_account")
 
# Команда type
@app.on_message(filters.command("t", prefixes=".") & filters.me)
def type(_, msg):
    orig_text = msg.text.split(".t", maxsplit=1)[1]
    text = orig_text
    tbp = "" # to be printed
    typing_symbol = "▒"
 
    while(tbp != orig_text):
        try:
            msg.edit(tbp + typing_symbol)
            sleep(0.005) # 50 ms
 
            tbp = tbp + text[0]
            text = text[1:]
 
            msg.edit(tbp)
            sleep(0.005)
 
        except FloodWait as e:
            sleep(e.x)

app.run()

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Daniil Kotyashkin, 2021-07-27
@ErVinTract

Are you sure you copied the error? This is just a message from pyrogram, even the translator did not hint at any mistake

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question