text: from os import environ
  import aiohttp
  from pyrogram import Client, filters
  
  API_ID = environ.get('API_ID')
  API_HASH = environ.get('API_HASH')
  BOT_TOKEN = environ.get('BOT_TOKEN')
  API_KEY = environ.get('API_KEY', '5fd20df0c4db85798dd4f5ff3d03e3606a94f98b')
  
  bot = Client('gplink bot',
               api_id=API_ID,
               api_hash=API_HASH,
               bot_token=BOT_TOKEN,
               workers=50,
               sleep_threshold=10)
  
  
  @bot.on_message(filters.command('start') & filters.private)
  async def start(bot, message):
      await message.reply(
          f"**Hi {message.chat.first_name}!**\n\n"
          "Hi David Iam At Your Service . Just send me link I Will Do Other Process And Give You Link")
  
  
  @bot.on_message(filters.regex(r'https?://[^\s]+') & filters.private)
  async def link_handler(bot, message):
      link = message.matches[0].group(0)
      try:
          short_link = await get_shortlink(link)
          await message.reply(f'Here is your [short link]({short_link})', quote=True)
      except Exception as e:
          await message.reply(f'Error: {e}', quote=True)
  
  
  async def get_shortlink(link):
      url = 'https://gplinks.in/api'
      params = {'api': API_KEY, 'url': link}
  
      async with aiohttp.ClientSession() as session:
          async with session.get(url, params=params, raise_for_status=True) as response:
              data = await response.json()
              return data["shortenedUrl"]
  
  
  bot.run()
  