Telegram Bot- error when using (frappe.db)

hi heros
i am trying to use telegram bot with erpnext
i crated documnt and in in documnet controller i called the bot
its working ok

but issue there wen truing to using frappe object like (frappe.db) or (frappe.session)
i get below errors

11:06:23 web.1 | Traceback (most recent call last):
11:06:23 web.1 | File “/home/hbx/frappe-bench/env/lib/python3.6/site-packages/telegram/ext/”, line 555, in process_update
11:06:23 web.1 | handler.handle_update(update, self, check, context)
11:06:23 web.1 | File “/home/hbx/frappe-bench/env/lib/python3.6/site-packages/telegram/ext/”, line 198, in handle_update
11:06:23 web.1 | return self.callback(update, context)
11:06:23 web.1 | File “/home/hbx/frappe-bench/apps/hbx/hbx/hbx_edu/doctype/hbx_edu_test/”, line 117, in got_contact
11:06:23 web.1 | subject = frappe.db.get_value(‘hbx_edu_telegram_user’, ‘TESTT’, ‘phone_number’)
11:06:23 web.1 | File “/home/hbx/frappe-bench/env/lib/python3.6/site-packages/werkzeug/”, line 348, in getattr
11:06:23 web.1 | return getattr(self._get_current_object(), name)
11:06:23 web.1 | File “/home/hbx/frappe-bench/env/lib/python3.6/site-packages/werkzeug/”, line 311, in _get_current_object
11:06:23 web.1 | raise RuntimeError(“no object bound to %s” %
11:06:23 web.1 | RuntimeError: no object bound to db

my code a below

import frappe
from frappe.model.document import Document
import telegram
from telegram import Update, ForceReply,KeyboardButton ,ReplyKeyboardMarkup  ,InlineKeyboardButton, InlineKeyboardMarkup
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters, CallbackContext 

class hbx_edu_test(Document):

@ frappe.whitelist()
def startbot():
    	# bot = telegram.Bot(token='1965958233:xxxxxxxxxxxxxxxx')
	updater = Updater(token='XXX', use_context=True)
	dispatcher = updater.dispatcher
	start_handler = CommandHandler('start', start)

	# print(bot.get_me())

def start(update: Update, context: CallbackContext) -> None:
	"""Send a message when the command /start is issued."""

	subject = frappe.db.get_value('hbx_edu_telegram_user', 'TESTT', 'phone_number')

	user = update.effective_user
	fr'Hi {user.mention_markdown_v2()}\!',

i think the issue that the start mathod called by bot and the session not initialized for this method

any one have idea how to let the bot methods to acess the frappe methods like frappe.db