Skip to content

Commit

Permalink
forgot to commit the example
Browse files Browse the repository at this point in the history
  • Loading branch information
double-fault committed Jul 26, 2019
1 parent 4e02496 commit ab8ba36
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions examples/simple_chatbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,12 @@ def test(event):
print(event)
print("woot")

def background_task(bot):
bot.post_global_message("this is a background task!")

bot.add_event_callback(test)

# Start the bot. The bot will run forever till a stop command is run. The reboot command will automatically reboot the bot.
# All background tasks specified and those automatically added will continue running till the bot stops.
bot.start()
bot.add_background_task(bp.BackgroundTask(lambda: background_task(bot), interval=5))

0 comments on commit ab8ba36

Please sign in to comment.