A
A
Adyl Abdinazarov2021-06-24 05:28:54
Python
Adyl Abdinazarov, 2021-06-24 05:28:54

How to fix "name 'message' is not defined" error in Telegram user bot?

Please tell me how to fix this error. I can't figure out where to define "Message".

from pyrogram import Client, filters
from pyrogram.errors import FloodWait


 
from pyrogram.types import ChatPermissions
 
import time
from time import sleep
import random


@app.on_message(filters.command("idi", prefixes=".") & filters.me)
def idi(_, msg):
    orig_text = msg.text.split(".idi ", maxsplit=1)[1]
    text = orig_text
    tbp = "" 

 
    while(tbp != orig_text):
        try:
            msg.edit("остань от меня")
            Messages.send_audio("C:/Users/User/Desktop/BOTS/user_bot/idi.mp3", 'rb')
 
            tbp = tbp + text[0]
            text = text[1:]
 

 
        except FloodWait as e:
            sleep(e.x)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question