Answer the question
In order to leave comments, you need to log in
How to add a class call to the list?
With the help of a get request, I get data of the form:
{
"status": true,
"data": [
{
"id": 1467,
"name": "name1",
},
{
"id": 3506,
"name": "name1",
},
{
"id": 7135,
"name": "name2",
},
{
"id": 996,
"name": "name2",
}
]
}
disnake.SelectOption(
label="id", description="name1", emoji=""
)
out = [x for x in data_dict if x['data']['name'] == 'name1']
, got an error TypeError: string indices must be integers
, but this is optional. Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question