File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55from mongoengine .errors import DoesNotExist , MultipleObjectsReturned
66
77from bot .core import BotTelegramCore
8+ from bot .messages import NOW_GROUP_RESTRICTED
89from db .subject import Subject
910from db .observer import UserObserver
1011from db .update_message import UpdateMessage
@@ -21,6 +22,14 @@ def now(update: Update, context: CallbackContext):
2122 chat = update .effective_chat
2223 message = update .effective_message
2324
25+ if not chat .type == "private" :
26+ available_vsps = "\n " .join ([subject .header for
27+ subject in Subject .objects .all ()])
28+ message .reply_text (NOW_GROUP_RESTRICTED , parse_mode = 'MARKDOWN' )
29+ message .reply_text (f"<b>Available VSP's are:</b>\n \n { available_vsps } " ,
30+ parse_mode = 'HTML' )
31+ return
32+
2433 try :
2534 observer = UserObserver .objects .get (chat_id = f"{ chat .id } " )
2635 except DoesNotExist :
Original file line number Diff line number Diff line change 55 "https://github.com/dcr-guys/JackBot/"
66
77ADMIN_RESTRICTED = "This command is restricted to admins only!"
8+
9+ NOW_GROUP_RESTRICTED = "The command `/now` without args is restricted on groups! Please call `/now` with args"
You can’t perform that action at this time.
0 commit comments