Skip to content

Commit

Permalink
Added status command to indicate when the bot started running
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-daniels committed Oct 26, 2014
1 parent 5af51b3 commit e920fb1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ws.py
Expand Up @@ -12,8 +12,12 @@
import re
import pickle
import os.path
from datetime import datetime

false_positives = []
startup_utc = datetime.utcnow()
startup_utc_str = "%i:%i:%i" % (startup_utc.hour, startup_utc.minute, startup_utc.second)

def load_false_positives():
if(os.path.isfile("falsePositives.txt")):
with open("falsePositives.txt", "r") as f:
Expand Down Expand Up @@ -253,6 +257,8 @@ def watcher(ev,wrap2):
roomm.send_message(':'+str(ev.data["message_id"]) + ' ' + random.choice(['Yup', 'You doubt me?', 'Of course', '... did I miss something?', 'plz send teh coffee', 'watching this endless list of new questions *never* gets boring', 'kinda sorta']))
if(ev.content.startswith("!!/rev?")):
postMessageInRoom(ev_room, ':'+str(ev.data["message_id"])+' [' + commit_with_author + '](https://github.com/Charcoal-SE/SmokeDetector/commit/'+ commit +')')
if(ev.content.startswith("!!/status")):
postMessageInRoom(ev_room, ':'+str(ev.data["message_id"])+' Running since %s UTC' % startup_utc_str)
if(ev.content.startswith("!!/reboot")):
if(isPrivileged(ev_room, ev_user_id)):
postMessageInRoom(ev_room, "Goodbye, cruel world")
Expand Down

0 comments on commit e920fb1

Please sign in to comment.