|
|
|
@ -23,6 +23,21 @@ def views(bot: Bot):
|
|
|
|
|
def handle_help(msg, _user, _args): |
|
|
|
|
bot.reply_with_template(msg, 'help') |
|
|
|
|
|
|
|
|
|
@bot.handle_commands(['/request', '📝 Request a meeting', '📝 Запросить встречу']) |
|
|
|
|
def request_meeting(msg, user, _args): |
|
|
|
|
comm_ids_and_names = [(community.chat_id, community.name) for community in user.communities] |
|
|
|
|
bot.reply_with_template(msg, 'request_meeting', comm_list=comm_ids_and_names) |
|
|
|
|
|
|
|
|
|
@bot.handle_callback('request_meeting') |
|
|
|
|
def request_meeting_callback(msg, user, args): |
|
|
|
|
community = Community.by_id(int(args), bot) |
|
|
|
|
if community.can_user_request_a_meeting(user.user_id): |
|
|
|
|
# todo: request the meeting and write the template |
|
|
|
|
bot.reply_with_template(msg, 'request_meeting_success', community=community) |
|
|
|
|
else: |
|
|
|
|
bot.reply_with_template(msg, 'request_meeting_failure', community=community) |
|
|
|
|
bot.answer_callback_query(msg.id) |
|
|
|
|
|
|
|
|
|
@bot.handle_commands(['/send_all']) |
|
|
|
|
def send_spam(msg, user, _args): |
|
|
|
|
if not user.is_admin(): |
|
|
|
|