101
102
103@bot.on(admin_cmd(pattern="servicemessage ?(.*)"))
104async def serv_msg(event):105 text = event.pattern_match.group(1)
106 if text == "off":
107 chat = await event.get_chat()
54
55
56@bot.on(admin_cmd(pattern="geta ?(.*)", allow_sudo=True))
57async def get_media(event):58 if event.fwd_from:
59 return
60 count = 0
A function, method or class is being redefined in the same scope. This would override the original definition, and doing this is strongly discouraged. Please verify that this is something that you intended to do. Redefining anything can lead to confusion, decreases code readability and may cause bugs that are difficult to diagnose. It is recommended either to refactor the function/method/class, or choose different names.
def calc(x, y):
return x + y
def calc(x, y):
return x * y
def calc_sum(x, y):
return x + y
def calc_product(x, y):
return x * y