コミットを比較

...

3 コミット

作成者 SHA1 メッセージ 日付
みてるぞ 99a5dca5a3 リプライが送信されないバグ修正(#17) (#18)
#17

Co-authored-by: miteruzo <miteruzo@naver.com>
Reviewed-on: #18
2025-12-03 22:48:57 +09:00
みてるぞ a6af306204 字数制限 2025-11-30 04:12:35 +09:00
みてるぞ 9f36cfea28 細部 2025-10-26 18:29:52 +09:00
9個のファイルの変更13行の追加26行の削除
+2
ファイルの表示
@@ -1,3 +1,5 @@
/__pycache__
/account.py
/connection.py
/db
/eloquent.pyi
-2
ファイルの表示
@@ -1,2 +0,0 @@
/db
/eloquent.pyi
-3
ファイルの表示
@@ -1,6 +1,3 @@
[submodule "nizika_nico"]
path = nizika_nico
url = https://git.miteruzo.com/miteruzo/nizika_nico
[submodule "nizika_ai"]
path = nizika_ai
url = https://git.miteruzo.com/miteruzo/nizika_ai.git
-1
ファイルの表示
@@ -1 +0,0 @@
nizika_nico/db
-1
ファイルの表示
@@ -1 +0,0 @@
db/eloquent.pyi
+9 -16
ファイルの表示
@@ -10,9 +10,9 @@ from typing import Any, TypedDict
import atproto # type: ignore
import requests
from atproto import Client # type: ignore
from atproto.models import AppBskyEmbedExternal, AppBskyEmbedImages # type: ignore
from atproto.models.AppBskyFeedPost import ReplyRef # type: ignore
from atproto_client.models import AppBskyEmbedExternal, AppBskyEmbedImages, ComAtprotoRepoStrongRef # type: ignore
from atproto_client.models.app.bsky.feed.get_timeline import Response # type: ignore
from atproto_client.models.app.bsky.feed.post import ReplyRef # type: ignore
from requests.exceptions import Timeout
import account
@@ -92,6 +92,8 @@ async def answer (
for answered_flag in answered_flags:
td: dict[str, Any]
answer = answered_flag.answer
answered_flag.answered = True
answered_flag.save ()
match QueryType (answer.query_rel.query_type):
case QueryType.BLUESKY_COMMENT:
td = answer.query_rel.transfer_data or { }
@@ -100,16 +102,13 @@ async def answer (
if (not uri) or (not cid):
continue
sref = { 'uri': uri, 'cid': cid }
strong_ref = atproto.models.create_strong_ref (sref) # type: ignore
strong_ref = ComAtprotoRepoStrongRef.Main (uri = uri, cid = cid)
reply_ref = ReplyRef (root = strong_ref, parent = strong_ref)
try:
client.post (answer.content, reply_to = reply_ref)
client.post (answer.content[:250], reply_to = reply_ref)
except Exception as e:
print (f"[answer/reply] { type (e).__name__ }: { e }")
continue
answered_flag.answered = True
answered_flag.save ()
case QueryType.KIRIBAN | QueryType.NICO_REPORT:
td = answer.query_rel.transfer_data or { }
video_code: str | None = td.get ('video_code')
@@ -136,12 +135,10 @@ async def answer (
uri = uri)
embed_external = AppBskyEmbedExternal.Main (external = external)
try:
client.post (answer.content, embed = embed_external)
client.post (answer.content[:250], embed = embed_external)
except Exception as e:
print (f"[answer/nico-post] { type (e).__name__ }: { e }")
continue
answered_flag.answered = True
answered_flag.save ()
case QueryType.SNACK_TIME:
try:
with open ('./assets/snack-time.jpg', 'rb') as f:
@@ -159,10 +156,8 @@ async def answer (
'下部に「おやつタイムだ!!!!」という'
'日本語のテキストが表示されている。'),
image = client.com.atproto.repo.upload_blob (f).blob)
client.post (answer.content,
client.post (answer.content[:250],
embed = AppBskyEmbedImages.Main (images = [image]))
answered_flag.answered = True
answered_flag.save ()
except Exception:
pass
case QueryType.HOT_SPRING:
@@ -180,10 +175,8 @@ async def answer (
'下部に「温泉に入ろう!!!」という'
'日本語のテキストが表示されている。'),
image = client.com.atproto.repo.upload_blob (f).blob)
client.post (answer.content,
client.post (answer.content[:250],
embed = AppBskyEmbedImages.Main (images = [image]))
answered_flag.answered = True
answered_flag.save ()
except Exception:
pass
await asyncio.sleep (10)
+1 -1
サブモジュール nicolib が更新されました: 32ecf2d00f...85670982f0
サブモジュール nizika_ai が更新されました: 3be6d9063c...1f75763038
サブモジュール nizika_nicob2f5f81ca8 から削除されました