Example #1
0
def on_warn_limit_action_received(update, context):
    set_warn_limit_action(get_admin_current_chat(update.effective_user.id),
                          update.effective_message.text)
    update.effective_message.reply_text(strings.get(
        strings.warn_settings_have_been_set, update),
                                        reply_markup=ReplyKeyboardRemove())
    return ConversationHandler.END
Example #2
0
def on_warn_limit_received(update, context):
    set_warn_limit(get_admin_current_chat(update.effective_user.id),
                   int(update.effective_message.text))
    update.effective_message.reply_text(
        strings.get(strings.ask_for_warn_limit_action, update),
        reply_markup=ReplyKeyboardMarkup(WARN_LIMIT_ACTIONS))
    return WAITING_FOR_WARN_LIMIT_ACTION
def on_language_received(update,context):
    current_chat=get_admin_current_chat(update.effective_user.id)
    set_chat_language(current_chat,LANGUAGE_CODES[update.effective_message.text])
    CHAT_TO_LANGUAGE[current_chat]=LANGUAGE_CODES[update.effective_message.text]
    update.effective_message.reply_text(strings.get(strings.language_has_been_set,update),
                                        reply_markup=ReplyKeyboardRemove())
    if update.effective_message.text not in COMPLETE_LANGUAGES:
        update.effective_message.reply_text(strings.get(strings.language_not_complete,update))
    return ConversationHandler.END
 def wrapper(update,context):
     user_id=update.effective_user.id
     if is_admin(user_id,get_admin_current_chat(user_id),context.bot):
         return func(update,context)
 def wrapper(update,context):
     if am_i_admin(context.bot,get_admin_current_chat(update.effective_user.id)):
         return func(update,context)
     update.effective_message.reply_text(strings.get(strings.am_i_admin,update.effective_chat))
Example #6
0
def on_macro_content_received(update, context):
    set_macro(get_admin_current_chat(update.effective_user.id),
              context.user_data['macro_name'], update.effective_message.text)
    update.effective_message.reply_text(
        strings.get(strings.macro_has_been_set, update))
    return ConversationHandler.END
Example #7
0
def on_rules_received(update, context):
    set_rules(get_admin_current_chat(update.effective_user.id),
              update.effective_message.text)
    update.effective_message.reply_text(
        strings.get(strings.rules_have_been_set, update))
    return ConversationHandler.END