Ejemplo n.º 1
0
 def assign_exercise(self):
     users = self.select_users()
     exercise = Exercise.get_random()
     annoucement = self.get_annoucement(users, exercise)
     if not Config.debug:
         Slack.send_message(self.channel, announcement)
     print announcement
Ejemplo n.º 2
0
 def fetch_active_users(self):
     ids = Slack.fetch_active_user_ids(self.id)
     users = [User(id) for id in ids]
     return users
Ejemplo n.º 3
0
 def __init__(self, user_id):
     self.id = user_id
     self.user = Slack.fetch_user(self.id)
     self.username = self.user["name"]
     self.realname = self.user["profile"]["real_name"]
     self.handle = ("@" + self.username).encode("utf-8")
Ejemplo n.º 4
0
 def is_active(self):
     return Slack.is_user_active(self.id)