Exemplo n.º 1
0
def echo_all(message):
    while True:
        mysql.start_bot(message.chat.id)
        user_id = message.chat.id
        message = message
        banned = mysql.user_tables(user_id)['banned']
        ticket_status = mysql.user_tables(user_id)['open_ticket']
        ticket_spam = mysql.user_tables(user_id)['open_ticket_spam']

        if banned == 1:
            return
        elif msg.spam_handler_warning(bot, user_id,
                                      message):  # First spam warning
            return
        elif msg.bad_words_handler(bot, message):
            return
        elif msg.spam_handler_blocked(
                bot, user_id, message
        ):  # Final spam warning // user cant send messages anymore
            return
        elif ticket_status == 0:
            mysql.open_ticket(user_id)
            continue
        else:
            msg.fwd_handler(user_id, bot, message)
            return
Exemplo n.º 2
0
def start(message):
    if message.chat.type == 'private':
        bot.send_message(message.chat.id,
                         config.text_messages['start'].format(
                             message.from_user.first_name) + msg.repo(),
                         parse_mode='Markdown',
                         disable_web_page_preview=True,
                         reply_markup=markup.faqButton())
        mysql.start_bot(message.chat.id)
    else:
        bot.reply_to(
            message,
            'Please send me a PM if you\'d like to talk to the Support Team.')