Compare commits
2 Commits
8715023f58
...
8aa6eadb39
Author | SHA1 | Date |
---|---|---|
Ben Harris | 8aa6eadb39 | |
Stef Dunlap | 2e242aea1e |
|
@ -26,7 +26,7 @@ def load(filepath: str):
|
||||||
|
|
||||||
server = config_yaml["server"]
|
server = config_yaml["server"]
|
||||||
hostname, port_s = server.split(":", 1)
|
hostname, port_s = server.split(":", 1)
|
||||||
tls = False
|
tls = None
|
||||||
|
|
||||||
if port_s.startswith("+"):
|
if port_s.startswith("+"):
|
||||||
tls = True
|
tls = True
|
||||||
|
@ -42,8 +42,8 @@ def load(filepath: str):
|
||||||
access_token=acct["access_token"],
|
access_token=acct["access_token"],
|
||||||
api_base_url=acct["api_base_url"],
|
api_base_url=acct["api_base_url"],
|
||||||
)
|
)
|
||||||
if "channel" in acct:
|
for channel in acct["channels"]:
|
||||||
channels[acct["channel"]] = acct["name"]
|
channels[channel] = acct["name"]
|
||||||
|
|
||||||
return Config(
|
return Config(
|
||||||
(hostname, port, tls),
|
(hostname, port, tls),
|
||||||
|
|
|
@ -36,6 +36,10 @@ def think(self, line):
|
||||||
res = account.toot(f"{status}\n~{author}")
|
res = account.toot(f"{status}\n~{author}")
|
||||||
if res:
|
if res:
|
||||||
return "tooted! {}".format(res["url"])
|
return "tooted! {}".format(res["url"])
|
||||||
|
else:
|
||||||
|
return "tooted failed :("
|
||||||
|
else:
|
||||||
|
return "no account :("
|
||||||
else:
|
else:
|
||||||
return HELP_TEXT
|
return HELP_TEXT
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue