Geocrack

json send temp

Jul 5th, 2022 (edited)
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.40 KB | None | 0 0
  1. import json
  2.  
  3. with open('data.json',"r") as f:
  4.     data = json.load(f)
  5.     data["Name"].append("John")
  6.  
  7. with open("data.json", "w") as outfile:
  8.     json.dump(data, outfile)
  9.    
  10.  
  11.  
  12. @bot.command()
  13. async def guilds(ctx):
  14.     with open("server.json", "r") as f:
  15.         data = json.load(f)
  16.         data["Name"].append(ctx.guild.name)
  17.     with open("server.json", "w") as f:
  18.         json.dump(data, f)
Advertisement
Add Comment
Please, Sign In to add comment