|
|
|
@ -28,9 +28,17 @@ def views(bot: Bot):
|
|
|
|
|
|
|
|
|
|
@bot.handle_commands(['/request', '📝 Request a meeting', '📝 Запросить встречу']) |
|
|
|
|
def request_meeting(msg, user, _args): |
|
|
|
|
# todo: don't allow this command in chats |
|
|
|
|
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_commands(['/join']) |
|
|
|
|
def join_community(msg, user, args): |
|
|
|
|
# send community link |
|
|
|
|
# todo: check if it really is a community |
|
|
|
|
community = Community.by_id(msg.chat.id, bot) |
|
|
|
|
bot.reply_with_template(msg, 'welcome', community=community, join=True) |
|
|
|
|
|
|
|
|
|
@bot.handle_callback('request_meeting') |
|
|
|
|
def request_meeting_callback(msg, user, args): |
|
|
|
|
community = Community.by_id(int(args), bot) |
|
|
|
|