2021年1月21日星期四

Posting sorted json data into a Discord table?

#remove stocks with 0 mentions  stock_with_mentions = dict((k, v) for k, v in stocks.items() if v >= 50)  #sort by value  sorted_stocks = {k: v for k, v in sorted(stock_with_mentions.items(), key=lambda item: item[1], reverse=True)}  print("STOCK MENTIONS")  print(sorted_stocks)    msg = Webhook(discordurl,msg="Stock Mentions WallStreetBets: \n\n"+str(sorted_stocks)+"")  msg.post()  

This code so far outputs it to Discord like this:

https://i.imgur.com/depnH6g.png

But I want it to be a table with 2 columns like this on Discord using embeds or whatever other way there is.

enter image description here

Any help would be much appreciated. Thanks!

https://stackoverflow.com/questions/65838005/posting-sorted-json-data-into-a-discord-table January 22, 2021 at 09:06AM

没有评论:

发表评论