def person_created(self, data): if announcements.announcement_is_enabled(self, announcement='new_person_created'): pcoaddress = "https://people.planningcenteronline.com/people/" + data['id'] attachment = msg_attachment.SlackAttachment("Lets all welcome %s!" % data['attributes']['name'], text="New Person added to Planning Center!\n" "Lets all welcome %s!" % data['attributes']['name'], button_text="Open in People", button_url=pcoaddress) self.say("", channel=announcements.announcement_channel(self), attachments=attachment.slack())
def live_service_updated(self, data): if announcements.announcement_is_enabled( self, announcement='live_service_update'): meta_data = live.parse_live_hook(data) attachment = live.get_plan_item(meta_data['service_type'], meta_data['plan_id'], meta_data['item_id']) time.sleep(10) self.say("", channel=announcements.announcement_channel(self), attachments=attachment.slack()) return
def this_channel(self, channel=None): self.say("This channel's name is %s" % self.message.data.channel.name, channel=announcements.announcement_channel(self)) self.say("This channel's id is %s" % self.message.data.channel.id, channel=announcements.announcement_channel(self))
def announce(self, message, announcement): self.say("Announcement! %s" % announcement.strip(' '), channel=announcements.announcement_channel(self))
def announce_birthdays(self): if announcements.announcement_is_enabled(self, announcement='birthdays'): birthday.announce_todays_birthdays( self, channel=announcements.announcement_channel(self))