text: from telegram.ext import Updater
  from telegram.ext import CommandHandler
  from telegram.ext import CallbackContext
  from telegram import Update
  from telegram.chataction import ChatAction
  
  token = "TOKEN"
  messages = {
      "msg_start": "سلام {} {} \n به ربات خوش آمدید.",
      "msg_sum": "مجموع اعداد به صورت زیر است: \n {}"
  }
  
  
  def start_handler(update: Update, context: CallbackContext):
      chat_id = update.message.chat_id
      first_name = update.message.chat.first_name
      last_name = update.message.chat.last_name
      context.bot.send_chat_action(chat_id, ChatAction.TYPING)
      update.message.reply_text(text=messages["msg_start"].format(first_name, last_name))
  
  
  def sum_handler(update: Update, context: CallbackContext):
      chat_id = update.message.chat_id
      numbers = context.args
      result = sum(int(i) for i in numbers)
      context.bot.send_chat_action(chat_id, ChatAction.TYPING)
      update.message.reply_text(text=messages["msg_sum"].format(result))
  
  
  def main():
      updater = Updater(token, use_context=True)
      updater.dispatcher.add_handler(CommandHandler("start", start_handler))
      updater.dispatcher.add_handler(CommandHandler("sum", sum_handler))
      updater.start_polling()
      updater.idle()
  
  
  main()
  
  