Skip to content

Client Bot Username #106

@Vitlyr

Description

@Vitlyr

So I have this code, where it tries to find-out the bots username, it returns with AttributeError: 'Client' object has no attribute 'user', is there a way to fix this?

from fastapi import FastAPI, Request, HTTPException, APIRouter
from fastapi.responses import HTMLResponse
import os
import requests
import ro_py
from ro_py.client import Client
from dotenv import load_dotenv

load_dotenv()

RobloxCookie = os.getenv("COOKIE")
client = ro_py.Client(RobloxCookie)

router = APIRouter()

async def get_bot_username():
    bot_username = client.user.name
    return bot_username

@router.get("/bot/username", response_class=HTMLResponse)
async def about(request: Request):
    bot_username = await get_bot_username()
    return bot_username

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions