Skip to content

Commit e8571f1

Browse files
committed
reverting changes made on telegram
1 parent 9ffa3ea commit e8571f1

File tree

2 files changed

+1
-42
lines changed

2 files changed

+1
-42
lines changed

app/telegram/handlers.py

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -134,14 +134,10 @@ async def process_new_event(self, memo_dict):
134134
return await self._process_content(memo_dict)
135135
elif 'location' not in memo_dict:
136136
return await self._process_location(memo_dict)
137-
elif 'is_public' not in memo_dict:
138-
return await self._process_is_public(memo_dict)
139137
elif 'start' not in memo_dict:
140138
return await self._process_start_date(memo_dict)
141139
elif 'end' not in memo_dict:
142140
return await self._process_end_date(memo_dict)
143-
elif 'end' not in memo_dict:
144-
return await self._process_end_date(memo_dict)
145141
elif self.chat.message == 'create':
146142
return await self._submit_new_event(memo_dict)
147143

@@ -188,37 +184,7 @@ async def _process_content(self, memo_dict):
188184
async def _process_location(self, memo_dict):
189185
memo_dict['location'] = self.chat.message
190186
answer = f'Location:\n{memo_dict["location"]}\n\n'
191-
answer += 'is the event public? (yes\\no)'
192-
await telegram_bot.send_message(
193-
chat_id=self.chat.user_id,
194-
text=answer,
195-
reply_markup=field_kb)
196-
return answer
197-
198-
async def _process_is_public(self, memo_dict):
199-
is_public_response = self.chat.message.lower()
200-
if is_public_response in ['yes', 'no']:
201-
print('yasss')
202-
return await self._add_is_public()
203-
return await self._process_bad_bool_input()
204-
205-
async def _process_bad_bool_input(self):
206-
answer = '❗️ Please, enter an answer of yes/no.'
207-
await telegram_bot.send_message(
208-
chat_id=self.chat.user_id,
209-
text=answer,
210-
reply_markup=field_kb)
211-
return answer
212-
213-
async def _add_is_public(self, memo_dict):
214-
if self.chat.message.lower == 'yes':
215-
memo_dict['is_public'] = True
216-
answer = 'public\\private event:\npublic event\n\n'
217-
else:
218-
answer = 'private event'
219-
memo_dict['is_public'] = False
220-
answer = 'public\\private event:\nprivate event\n\n'
221-
answer += '\nWhen does it start?'
187+
answer += 'When does it start?'
222188
await telegram_bot.send_message(
223189
chat_id=self.chat.user_id,
224190
text=answer,
@@ -282,7 +248,6 @@ async def _submit_new_event(self, memo_dict):
282248
content=memo_dict['content'],
283249
owner_id=self.user.id,
284250
location=memo_dict['location'],
285-
is_public=memo_dict['is_public'],
286251
)
287252
# Delete current session
288253
del telegram_bot.MEMORY[self.chat.user_id]

tests/test_a_telegram_asyncio.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -245,12 +245,6 @@ async def test_process_new_event(self):
245245
chat = Chat(gen_message('Universe'))
246246
message = MessageHandler(chat, self.TEST_USER)
247247
answer = 'Location:\nUniverse\n\n'
248-
answer += 'is the event public? (yes\\no)'
249-
assert await message.process_callback() == answer
250-
251-
chat = Chat(gen_message('yes'))
252-
message = MessageHandler(chat, self.TEST_USER)
253-
answer = 'public\\private event:\npublic event\n\n'
254248
answer += 'When does it start?'
255249
assert await message.process_callback() == answer
256250

0 commit comments

Comments
 (0)