Skip to content

Commit

Permalink
update config key names
Browse files Browse the repository at this point in the history
  • Loading branch information
A-Baji committed Jun 30, 2024
1 parent 80686e8 commit 209780c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions discordai/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ def get():
print(f"Set OPENAI_API_KEY value to {openai_key}")

config = dict(
token=token or input("\nEnter your discord bot token: "),
openai_key=openai_key or input("\nEnter your openAI key: "),
DISCORD_BOT_TOKEN=token or input("\nEnter your discord bot token: "),
OPENAI_API_KEY=openai_key or input("\nEnter your openAI key: "),
)
save(json.dumps(config))
save(config)
print(f"Your config has been saved to {config_dir / 'config.json'}")

return config
Expand All @@ -36,4 +36,4 @@ def get():
def save(config):
os.makedirs(config_dir, exist_ok=True)
with open(pathlib.Path(config_dir, "config.json"), "w") as f:
f.write(config)
f.write(json.dumps(config))

0 comments on commit 209780c

Please sign in to comment.