I am making a small discord.py bot that interacts with a game stats api, I got the bot to respond with the correct information now I am just trying to find a way to format the reply so it look neater, I have seen many tutorials on how to format strings but for my case none of them worked.
@client.command()
async def show(ctx, player,): # General stats
rs = requests.get(apiLink + "/checkban?name=" + str(player))
if rs.status_code == 200: # HTTP OK
rs = rs.json()
embed = discord.Embed(title="Other users for" + str(player), description="""User is known as:
""" +(str(rs["otherNames"]['usedNames'])))
await ctx.send(embed=embed)
Here is a picture of the reply in discord
How would I go to remove the quotation marks and the brackets in the reply? I know how to make it work with printed next but I haven't found help when the text is pulled from a web json api and embedded.
Thank you! :)
join
function in python. Assuming that you have an array of all names that you need to display, you can use','.join({array_name})
to join all the values while putting commas between each one – Saurav Chittaldescription
arg of the embed to that variable. – Aditya Tomar