Browse Source

おやつタイム画像追加

main
みてるぞ 2 weeks ago
parent
commit
3229f1b6c0
2 changed files with 8 additions and 1 deletions
  1. BIN
      assets/snack-time.jpg
  2. +8
    -1
      main.py

BIN
assets/snack-time.jpg View File

Before After
Width: 2000  |  Height: 1124  |  Size: 171 KiB

+ 8
- 1
main.py View File

@@ -87,7 +87,14 @@ def main () -> None:
has_got_snack_time = False has_got_snack_time = False


if now.hour == 15 and not has_got_snack_time: if now.hour == 15 and not has_got_snack_time:
client.send_post (Talk.main ('おやつタイムだ!!!!'))
with open ('./assets/snack-time.jpg', 'rb') as f:
image = models.AppBskyEmbedImages.Image (
alt = 'おやつタイムだ!!!!',
image = client.com.atproto.repo.upload_blob (f).blob)

client.send_post (Talk.main ('おやつタイムだ!!!!'),
embed = models.app.bsky.embed.images.Main (
images = [image]))
last_posted_at = now last_posted_at = now


has_got_snack_time = True has_got_snack_time = True


Loading…
Cancel
Save