diff options
author | clarkzjw <[email protected]> | 2023-02-27 15:18:48 -0800 |
---|---|---|
committer | clarkzjw <[email protected]> | 2023-02-27 15:18:48 -0800 |
commit | 0808f28fa7764694c0e52ce68e077dcbf05be322 (patch) | |
tree | 322e98152dd720a7f0ce4c4dc0247f24e30ad491 | |
parent | 23aef802c9b493aeb66a1c250b6a3d16d299e63c (diff) | |
download | swarm2fediverse-0808f28fa7764694c0e52ce68e077dcbf05be322.tar.gz |
misskey is not supported
-rw-r--r-- | README.md | 12 | ||||
-rw-r--r-- | callback.py | 16 | ||||
-rw-r--r-- | prompt/string.py | 2 |
3 files changed, 16 insertions, 14 deletions
@@ -7,19 +7,15 @@ Foursquare Swarm like Telegram bot to check in at places and post to Fediverse ( | |||
7 | - [x] Telegram native location venue checkin | 7 | - [x] Telegram native location venue checkin |
8 | - [x] Telegram raw GPS location checkin | 8 | - [x] Telegram raw GPS location checkin |
9 | - [x] Attach additional comments and medias (photos, up to 4) with checkins | 9 | - [x] Attach additional comments and medias (photos, up to 4) with checkins |
10 | |||
11 | ## TODO: | ||
12 | |||
13 | - [x] OAuth2 login | 10 | - [x] OAuth2 login |
14 | |||
15 | - Supported Fediverse software | 11 | - Supported Fediverse software |
16 | - [x] Mastodon | 12 | - [x] Mastodon |
17 | - [x] Pleroma | 13 | - [x] Pleroma |
18 | - [ ] Misskey | ||
19 | 14 | ||
15 | ## TODO: | ||
16 | |||
20 | - [ ] Option to set individual checkin visibility | 17 | - [ ] Option to set individual checkin visibility |
21 | - [ ] Delayed checkins (Scheduled posts on Fediverse) | 18 | - [ ] Delayed checkins (Scheduled posts on Fediverse) |
22 | - [ ] Connect multiple Fediverse accounts | 19 | - [ ] Connect multiple Fediverse accounts |
23 | - [ ] add Telegram payment option to enable raw GPS checkins | 20 | - [ ] add Telegram payment option to enable raw GPS checkins |
24 | - [ ] i18n | ||
25 | - [ ] Anonymized usage analysis, monitoring (Grafana/Prometheus) | 21 | - [ ] Anonymized usage analysis, monitoring (Grafana/Prometheus) |
diff --git a/callback.py b/callback.py index cb6a8d3..7530afb 100644 --- a/callback.py +++ b/callback.py | |||
@@ -82,12 +82,16 @@ async def process_media_group(context: CallbackContext): | |||
82 | 82 | ||
83 | async def callback_generate_fedi_login_url(update: Update, context: ContextTypes.DEFAULT_TYPE) -> int: | 83 | async def callback_generate_fedi_login_url(update: Update, context: ContextTypes.DEFAULT_TYPE) -> int: |
84 | home_instance = update.effective_message.text | 84 | home_instance = update.effective_message.text |
85 | client_id, client_secret = Mastodon.create_app( | 85 | try: |
86 | "Checkin.bot", | 86 | client_id, client_secret = Mastodon.create_app( |
87 | scopes=BOT_SCOPE, | 87 | "Checkin.bot", |
88 | redirect_uris="{}{}".format(BOT_DOMAIN, FEDI_LOGIN_CALLBACK_URL), | 88 | scopes=BOT_SCOPE, |
89 | api_base_url=home_instance, | 89 | redirect_uris="{}{}".format(BOT_DOMAIN, FEDI_LOGIN_CALLBACK_URL), |
90 | ) | 90 | api_base_url=home_instance, |
91 | ) | ||
92 | except KeyError as e: | ||
93 | await update.message.reply_text(PROMPT_INVALID_INSTANCE) | ||
94 | return FEDI_LOGIN | ||
91 | 95 | ||
92 | m = Mastodon(client_id=client_id, client_secret=client_secret, api_base_url=home_instance) | 96 | m = Mastodon(client_id=client_id, client_secret=client_secret, api_base_url=home_instance) |
93 | 97 | ||
diff --git a/prompt/string.py b/prompt/string.py index 2fe13f6..e60085c 100644 --- a/prompt/string.py +++ b/prompt/string.py | |||
@@ -20,6 +20,8 @@ By using this bot, you agree to the following terms of service:\n\n | |||
20 | 20 | ||
21 | PROMPT_FEDI_LOGIN_WHERE_IS_INSTANCE = "Where is your home instance in the Fediverse? (e.g. `https://mastodon.social`)" | 21 | PROMPT_FEDI_LOGIN_WHERE_IS_INSTANCE = "Where is your home instance in the Fediverse? (e.g. `https://mastodon.social`)" |
22 | PROMPT_FEDI_LOGIN = "Please login to your Fediverse account by clicking the link below:" | 22 | PROMPT_FEDI_LOGIN = "Please login to your Fediverse account by clicking the link below:" |
23 | PROMPT_INVALID_INSTANCE = "Your home instance (Probably a Misskey or GotoSocial instance?) is not supported. " \ | ||
24 | "Currently, only Mastodon or Pleroma instances are supported." | ||
23 | PROMPT_CHOOSE_ACTION = "Use bot keyboard to choose an action" | 25 | PROMPT_CHOOSE_ACTION = "Use bot keyboard to choose an action" |
24 | PROMPT_ADD_COMMENT = "You can continue adding comments, or press skip" | 26 | PROMPT_ADD_COMMENT = "You can continue adding comments, or press skip" |
25 | PROMPT_ADD_MEDIA = "You can continue adding photos, or press skip" | 27 | PROMPT_ADD_MEDIA = "You can continue adding photos, or press skip" |