|
|
|
@ -193,10 +193,13 @@ class Bot(telebot.TeleBot):
|
|
|
|
|
yield Community.from_dict(community_data) |
|
|
|
|
|
|
|
|
|
def poll_user_for_community(self, user: User, community: Community): |
|
|
|
|
def_answer = False # community.default_answers.get(user.user_id, True) |
|
|
|
|
self.send_template(user.user_id, 'poll_user', community=community, answer=def_answer) |
|
|
|
|
community.pool += [user.user_id] * def_answer |
|
|
|
|
community.polled[user.user_id] = datetime.date.today() |
|
|
|
|
try: |
|
|
|
|
def_answer = False # community.default_answers.get(user.user_id, True) |
|
|
|
|
community.polled[user.user_id] = datetime.date.today() |
|
|
|
|
self.send_template(user.user_id, 'poll_user', community=community, answer=def_answer) |
|
|
|
|
community.pool += [user.user_id] * def_answer |
|
|
|
|
except telebot.apihelper.ApiTelegramException: |
|
|
|
|
pass |
|
|
|
|
|
|
|
|
|
def poll_users_in_community(self, community: Community): |
|
|
|
|
for user_id in community.users_to_poll(): |
|
|
|
@ -223,9 +226,12 @@ class Bot(telebot.TeleBot):
|
|
|
|
|
|
|
|
|
|
def send_meeting_info_in_community(self, community: Community): |
|
|
|
|
for meeting in community.scheduled_meetings: |
|
|
|
|
person_1, person_2 = self.get_chat(meeting[0]), self.get_chat(meeting[1]) |
|
|
|
|
self.send_template(meeting[0], 'meeting_info', community=community, meeting=meeting, person=person_2) |
|
|
|
|
self.send_template(meeting[1], 'meeting_info', community=community, meeting=meeting, person=person_1) |
|
|
|
|
try: |
|
|
|
|
person_1, person_2 = self.get_chat(meeting[0]), self.get_chat(meeting[1]) |
|
|
|
|
self.send_template(meeting[0], 'meeting_info', community=community, meeting=meeting, person=person_2) |
|
|
|
|
self.send_template(meeting[1], 'meeting_info', community=community, meeting=meeting, person=person_1) |
|
|
|
|
except telebot.apihelper.ApiTelegramException: |
|
|
|
|
pass |
|
|
|
|
community.archived_meetings += community.scheduled_meetings |
|
|
|
|
community.scheduled_meetings = [] |
|
|
|
|
self.save_community(community) |
|
|
|
|