Answer the question
In order to leave comments, you need to log in
/stop command for bot?
How to implement /stop command for bot in telegram? Googled for a day and found nothing. In the documentation xs how to dig on this issue (
Answer the question
In order to leave comments, you need to log in
import os
@bot.message_handler(commands=["stop"])
def stop(message):
if message.from_user.username == cfg.Father:
pid = str(os.getpid())
stoper = open('ozerx/stoper.bat', 'w')
stoper.write("Taskkill /PID " + pid + " /F")
stoper.close()
os.system('C:/Users/smp/Desktop/SMP/ozerx/stoper.bat')
else:
bot.send_message(message.chat.id, "Ты не Создатель бота; у тебя нет админ-прав, проваливай!")
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question