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
def fetch_active_users(self): ids = Slack.fetch_active_user_ids(self.id) users = [User(id) for id in ids] return users
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")
def is_active(self): return Slack.is_user_active(self.id)