Skip to content

Commit 0b97adc

Browse files
authored
elif on another location (#48)
- fix `/now` restricted wrongly on groups making impossible to call with args
1 parent bbfb15d commit 0b97adc

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

bot/commands/subject.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,6 @@ def now(update: Update, context: CallbackContext):
2222
chat = update.effective_chat
2323
message = update.effective_message
2424

25-
if not chat.type == "private":
26-
available_vsps = "\n".join([subject.header for
27-
subject in Subject.objects.all()])
28-
message.reply_text(f"{GROUP_RESTRICTED} {CALL_NOW}",
29-
parse_mode='MARKDOWN')
30-
message.reply_text(f"<b>Available VSP's are:</b>\n\n{available_vsps}",
31-
parse_mode='HTML')
32-
return
33-
3425
try:
3526
observer = UserObserver.objects.get(chat_id=f"{chat.id}")
3627
except DoesNotExist:
@@ -52,6 +43,14 @@ def now(update: Update, context: CallbackContext):
5243
errors.append(f"{e}\n"
5344
f"The value {name} returned more than "
5445
f"one subject. Please be more specific!")
46+
elif not chat.type == "private":
47+
available_vsps = "\n".join([subject.header for
48+
subject in Subject.objects.all()])
49+
message.reply_text(f"{GROUP_RESTRICTED} {CALL_NOW}",
50+
parse_mode='MARKDOWN')
51+
message.reply_text(f"<b>Available VSP's are:</b>\n\n{available_vsps}",
52+
parse_mode='HTML')
53+
return
5554
else:
5655
subjects = Subject.objects.all()
5756

0 commit comments

Comments
 (0)