text: from aiohttp import ClientResponseError
  from nonebot import on_command
  from nonebot.adapters.onebot.v11 import MessageEvent, MessageSegment
  from nonebot.typing import T_State
  
  from ..data_source.rating_compose import *
  from ..utils.image import *
  
  best_50_pic = on_command('b50')
  
  
  @best_50_pic.handle()
  async def _(event: MessageEvent, state: T_State):
      try:
          args = str(event.get_message()).strip().split()[1:]
          if len(args) > 0:
              img = await generate_b50_image(username=args[0])
          else:
              img = await generate_b50_image(qq=event.user_id)
  
          await best_50_pic.send(MessageSegment.image(f"base64://{str(image_to_base64(img), encoding='utf-8')}"))
      except ClientResponseError as e:
          if e.status == 400:
              await best_50_pic.send("未找到此玩家，请确保此玩家的用户名和查分器中的用户名相同。")
          elif e.status == 403:
              await best_40_pic.send("该用户禁止了其他人获取数据。")
  