diff --git a/bot.py b/bot.py index 8048c0d..0fe6efd 100644 --- a/bot.py +++ b/bot.py @@ -195,12 +195,13 @@ def run(self): self.gameboy.empty_directory(gif_dir) image = self.gameboy.screenshot() + alt_text = 'Screenshot of ' + self.gameboy_config.get('title', 'a Game Boy game.') media = self.retry_mastodon_call( - self.mastodon.media_post, - retries=5, - interval=10, - media_file=image, - description="Screenshot of Pokemon Gold", + self.mastodon.media_post, + retries=5, + interval=10, + media_file=image, + description=alt_text ) media_ids = [] # Probably add a check here if generating a gif is enabled (so we don't @@ -229,6 +230,8 @@ def run(self): media_ids=[media_ids], ) + poll_duration = self.mastodon_config.get('poll_duration', 60) + poll = self.retry_mastodon_call( self.post_poll, retries=5, @@ -244,6 +247,7 @@ def run(self): "Start", "Select", ], + expires_in=poll_duration*60, reply_id=post["id"], ) @@ -254,7 +258,6 @@ def run(self): post_id=post["id"], poll_id=poll["id"], ) - result = False if result: gif = self.retry_mastodon_call( diff --git a/config.toml.example b/config.toml.example index c656ea8..dd0e1d4 100644 --- a/config.toml.example +++ b/config.toml.example @@ -1,6 +1,8 @@ [mastodon] server = "https://tomkahe.com" access_token = "" +poll_duration = 60 [gameboy] rom = "Pokemon - Gold Version.gbc" +title = "Pokémon Gold" \ No newline at end of file