diff options
| author | Tulir Asokan <tulir@maunium.net> | 2024-06-05 13:02:34 +0300 |
|---|---|---|
| committer | Tulir Asokan <tulir@maunium.net> | 2024-06-05 13:02:34 +0300 |
| commit | dbc3a9fbb8017cf91404d50be9986b89a1a56275 (patch) | |
| tree | 4a4c24de7a8e129294ecc0edfbb6e7f610bd1a35 /sticker | |
| parent | 47f17fde452b5e9f0c9e96ce0e2c878dd0574b7f (diff) | |
Don't prompt for giphy api key by default
Diffstat (limited to 'sticker')
| -rw-r--r-- | sticker/lib/matrix.py | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/sticker/lib/matrix.py b/sticker/lib/matrix.py index d048603..de436a7 100644 --- a/sticker/lib/matrix.py +++ b/sticker/lib/matrix.py @@ -55,23 +55,10 @@ async def load_config(path: str) -> None: config = json.load(config_file) homeserver_url = config["homeserver"] access_token = config["access_token"] - try: - giphy_api_key = config["giphy_api_key"] - giphy_mxc_prefix = config["giphy_mxc_prefix"] - except KeyError: - # these two are not mandatory, assume GIF search is disabled - print("Giphy related parameters not found in the config file.") except FileNotFoundError: print("Matrix config file not found. Please enter your homeserver and access token.") homeserver_url = input("Homeserver URL: ") access_token = input("Access token: ") - print("If you want to enable GIF search, enter your giphy API key. Otherwise, leave it empty.") - giphy_api_key = input("Giphy API key: ").strip() - giphy_mxc_prefix = "mxc://giphy.mau.dev/" - if giphy_api_key: - print("If you want to self-host the matrix->giphy proxy, enter the mxc URI prefix here") - print("Defaults to mxc://giphy.mau.dev/ if left empty.") - giphy_mxc_prefix = input("Giphy MXC prefix: ").strip() or giphy_mxc_prefix whoami_url = URL(homeserver_url) / "_matrix" / "client" / "r0" / "account" / "whoami" if whoami_url.scheme not in ("https", "http"): whoami_url = whoami_url.with_scheme("https") |
