@app.on_message(gen('dspam', allow=['sudo']))
async def delay_spam(_, m: Message):
    if ((len(m.command) > 2) and (not m.reply_to_message)):
        (await m.delete())
        msg = m.text.split(None, 3)
        sec = int(msg[1])
        times = int(msg[2])
        text = msg[3]
        for x in range(times):
            (await app.send_message(m.chat.id, text))
            (await asyncio.sleep(sec))
    else:
        (await app.send_edit(m, 'Something wrong in spam command !'))
@app.on_message(gen('dspam', allow=['sudo']))
async def delay_spam(_, m: Message):
    if ((len(m.command) > 2) and (not m.reply_to_message)):
        (await m.delete())
        msg = m.text.split(None, 3)
        sec = int(msg[1])
        times = int(msg[2])
        text = msg[3]
        for x in range(times):
            (await app.send_message(m.chat.id, text))
            (await asyncio.sleep(sec))
    else:
        (await app.send_edit(m, 'Something wrong in spam command !'))