#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:
But I want it to be a table with 2 columns like this on Discord using embeds or whatever other way there is.
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
没有评论:
发表评论