from telegram import InlineKeyboardButton, InlineKeyboardMarkup
from telegram.ext import Filters

from config import Config
from globals import owner


def setup_handlers(bot):

    @bot.handle.command()
    def start(update, context):
        user = update.message.from_user
        context.bot.send_message(
            chat_id=update.effective_chat.id,
            text=f"Hello {user['first_name']}, my name is {Config.BOT_NAME}, how can I help you?",
        )
        bot.help(update, context)

    @bot.handle.message(Filters.text & (~Filters.command))
    def echo(update, context):
        context.bot.send_message(chat_id=update.effective_chat.id, text=update.message.text)

    @bot.handle.command()
    @bot.handle.callback_query()
    def menu(update, context):
        """ Opens up the main menu """

        update_message_text = update.callback_query.edit_message_text if update.callback_query else update.message.reply_text
        update_message_text(
            text='Please choose an option.',
            reply_markup=InlineKeyboardMarkup([
                [
                    InlineKeyboardButton('Author Details', callback_data='details'),
                    InlineKeyboardButton('Help', callback_data='help'),
                ],
                [
                    InlineKeyboardButton('Linkedin Profile', url=Config.OWNER_WEBSITE),
                    InlineKeyboardButton('Github repo', url=Config.GITHUB_REPO_URL),
                ],
                [
                    InlineKeyboardButton('Download CV', url=Config.DOWNLOAD_CV_URL)
                ]
            ]),
        )

    @bot.handle.command()
    @bot.handle.callback_query()
    def details(update, context):
        """Receive some personal details about the owner"""
        context.bot.send_message(chat_id=update.effective_chat.id, text=str(owner))

    @bot.handle.message(Filters.command)
    def unknown(update, context):
        user = update.message.from_user
        context.bot.send_message(
            chat_id=update.effective_chat.id,
            text=f"Sorry {user['first_name']}, I didn't understand your command.\nUse /help for guidance.",
        )

73731999ae2fdb43a00e6e5a8c2ac661f77a2723
<mask token>

<mask token>


def setup_handlers(bot):

    @bot.handle.command()
    def start(update, context):
        user = update.message.from_user
        context.bot.send_message(chat_id=update.effective_chat.id, text=
            f"Hello {user['first_name']}, my name is {Config.BOT_NAME}, how can I help you?"
            )
        bot.help(update, context)

    @bot.handle.message(Filters.text & ~Filters.command)
    def echo(update, context):
        context.bot.send_message(chat_id=update.effective_chat.id, text=
            update.message.text)

    @bot.handle.command()
    @bot.handle.callback_query()
    def menu(update, context):
        """ Opens up the main menu """
        update_message_text = (update.callback_query.edit_message_text if
            update.callback_query else update.message.reply_text)
        update_message_text(text='Please choose an option.', reply_markup=
            InlineKeyboardMarkup([[InlineKeyboardButton('Author Details',
            callback_data='details'), InlineKeyboardButton('Help',
            callback_data='help')], [InlineKeyboardButton(
            'Linkedin Profile', url=Config.OWNER_WEBSITE),
            InlineKeyboardButton('Github repo', url=Config.GITHUB_REPO_URL)
            ], [InlineKeyboardButton('Download CV', url=Config.
            DOWNLOAD_CV_URL)]]))

    @bot.handle.command()
    @bot.handle.callback_query()
    def details(update, context):
        """Receive some personal details about the owner"""
        context.bot.send_message(chat_id=update.effective_chat.id, text=str
            (owner))

    @bot.handle.message(Filters.command)
    def unknown(update, context):
        user = update.message.from_user
        context.bot.send_message(chat_id=update.effective_chat.id, text=
            f"""Sorry {user['first_name']}, I didn't understand your command.
Use /help for guidance."""
            )

from telegram import InlineKeyboardButton, InlineKeyboardMarkup
from telegram.ext import Filters
from config import Config
from globals import owner


def setup_handlers(bot):

    @bot.handle.command()
    def start(update, context):
        user = update.message.from_user
        context.bot.send_message(chat_id=update.effective_chat.id, text=
            f"Hello {user['first_name']}, my name is {Config.BOT_NAME}, how can I help you?"
            )
        bot.help(update, context)

    @bot.handle.message(Filters.text & ~Filters.command)
    def echo(update, context):
        context.bot.send_message(chat_id=update.effective_chat.id, text=
            update.message.text)

    @bot.handle.command()
    @bot.handle.callback_query()
    def menu(update, context):
        """ Opens up the main menu """
        update_message_text = (update.callback_query.edit_message_text if
            update.callback_query else update.message.reply_text)
        update_message_text(text='Please choose an option.', reply_markup=
            InlineKeyboardMarkup([[InlineKeyboardButton('Author Details',
            callback_data='details'), InlineKeyboardButton('Help',
            callback_data='help')], [InlineKeyboardButton(
            'Linkedin Profile', url=Config.OWNER_WEBSITE),
            InlineKeyboardButton('Github repo', url=Config.GITHUB_REPO_URL)
            ], [InlineKeyboardButton('Download CV', url=Config.
            DOWNLOAD_CV_URL)]]))

    @bot.handle.command()
    @bot.handle.callback_query()
    def details(update, context):
        """Receive some personal details about the owner"""
        context.bot.send_message(chat_id=update.effective_chat.id, text=str
            (owner))

    @bot.handle.message(Filters.command)
    def unknown(update, context):
        user = update.message.from_user
        context.bot.send_message(chat_id=update.effective_chat.id, text=
            f"""Sorry {user['first_name']}, I didn't understand your command.
Use /help for guidance."""
            )

from telegram import InlineKeyboardButton, InlineKeyboardMarkup
from telegram.ext import Filters

from config import Config
from globals import owner


def setup_handlers(bot):

    @bot.handle.command()
    def start(update, context):
        user = update.message.from_user
        context.bot.send_message(
            chat_id=update.effective_chat.id,
            text=f"Hello {user['first_name']}, my name is {Config.BOT_NAME}, how can I help you?",
        )
        bot.help(update, context)

    @bot.handle.message(Filters.text & (~Filters.command))
    def echo(update, context):
        context.bot.send_message(chat_id=update.effective_chat.id, text=update.message.text)

    @bot.handle.command()
    @bot.handle.callback_query()
    def menu(update, context):
        """ Opens up the main menu """

        update_message_text = update.callback_query.edit_message_text if update.callback_query else update.message.reply_text
        update_message_text(
            text='Please choose an option.',
            reply_markup=InlineKeyboardMarkup([
                [
                    InlineKeyboardButton('Author Details', callback_data='details'),
                    InlineKeyboardButton('Help', callback_data='help'),
                ],
                [
                    InlineKeyboardButton('Linkedin Profile', url=Config.OWNER_WEBSITE),
                    InlineKeyboardButton('Github repo', url=Config.GITHUB_REPO_URL),
                ],
                [
                    InlineKeyboardButton('Download CV', url=Config.DOWNLOAD_CV_URL)
                ]
            ]),
        )

    @bot.handle.command()
    @bot.handle.callback_query()
    def details(update, context):
        """Receive some personal details about the owner"""
        context.bot.send_message(chat_id=update.effective_chat.id, text=str(owner))

    @bot.handle.message(Filters.command)
    def unknown(update, context):
        user = update.message.from_user
        context.bot.send_message(
            chat_id=update.effective_chat.id,
            text=f"Sorry {user['first_name']}, I didn't understand your command.\nUse /help for guidance.",
        )
