From c6b7929167adffa0a1cf5b2054a7eea985ac058b Mon Sep 17 00:00:00 2001 From: Albert Sanchez Date: Fri, 5 Nov 2021 21:52:27 -0500 Subject: [PATCH] Slight tweak in pseud.json config format --- README.md | 12 +++++++----- examples/pseud.example.json | 12 +++++++----- pseudbot/cli.py | 2 +- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 2f51e9c..824a5c0 100644 --- a/README.md +++ b/README.md @@ -61,11 +61,13 @@ Create a file named `pseud.json` with your editor and paste in the API keys you just created on Twitter's developer page in the previous step: ```json { - "consumer": "key goes here", - "consumer_secret": "key goes here", - "bearer_token": "key goes here", - "tok": "key goes here", - "tok_secret": "key goes here" + "twitter": { + "consumer": "key goes here", + "consumer_secret": "key goes here", + "bearer_token": "key goes here", + "tok": "key goes here", + "tok_secret": "key goes here" + } } ``` diff --git a/examples/pseud.example.json b/examples/pseud.example.json index 8268fea..74c49b4 100644 --- a/examples/pseud.example.json +++ b/examples/pseud.example.json @@ -1,7 +1,9 @@ { - "consumer": "key goes here", - "consumer_secret": "key goes here", - "bearer_token": "key goes here", - "tok": "key goes here", - "tok_secret": "key goes here" + "twitter": { + "consumer": "key goes here", + "consumer_secret": "key goes here", + "bearer_token": "key goes here", + "tok": "key goes here", + "tok_secret": "key goes here" + } } diff --git a/pseudbot/cli.py b/pseudbot/cli.py index ec29e9f..7ed3824 100644 --- a/pseudbot/cli.py +++ b/pseudbot/cli.py @@ -69,7 +69,7 @@ def main(args: [str], name: str) -> int: custom_welcome = get_timestamp_s() + ': Running method: "{}"'.format( opts.action ) - tcfg = j.loads(opts.cfg_json.read()) + tcfg = j.loads(opts.cfg_json.read())["twitter"] if opts.action == "run_bot": pb = PseudBot(tcfg=tcfg, proxy_url=opts.proxy_url, debug=opts.debug)