From 741f817f2803d6c9d8e2c497768dbc6c01c78e9f Mon Sep 17 00:00:00 2001 From: spla Date: Wed, 25 Nov 2020 13:15:43 +0100 Subject: [PATCH] Get game anotations even if it's not finalized yet --- mastochess.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/mastochess.py b/mastochess.py index e480968..b9985d6 100644 --- a/mastochess.py +++ b/mastochess.py @@ -1507,6 +1507,30 @@ if __name__ == '__main__': update_replies(status_id, username, now) + elif query_word[0:5] == 'envia': + + query_word_length = len(query_word) + + send_game = query_word[6:query_word_length].replace(' ', '') + + emailed, game_id, game_found = send_anotation(send_game) + + if emailed == False and game_found == True: + + toot_text = "@"+username + " error al enviar les anotacions :-(" + + elif emailed == True and game_found == True: + + toot_text = "@"+username + " les anotaciones de la partida n." + str(game_id) + " enviades amb èxit!" + + elif emailed == False and game_found == False: + + toot_text = "@"+username + " la partida n." + str(game_id) + " no existeix..." + + mastodon.status_post(toot_text, in_reply_to_id=status_id,visibility=visibility) + + update_replies(status_id, username, now) + else: if playing_user == None: