Repost messages from telegram to mastodon.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
440 B

import json
import os.path
if not os.path.isfile("subscriptions.secret"):
with open("subscriptions.secret", "w") as file:
file.write("{}")
with open("subscriptions.secret", "r") as file:
j = json.load(file)
j[input("Channel username: ").replace("@", "").strip().lower()] = {
"name": input("Mastodon account name: ").strip(),
"viewed": [],
}
with open("subscriptions.secret", "w") as file:
json.dump(j, file)