mirror of
https://github.com/TriM-Organization/LiteyukiBot-TriM.git
synced 2024-11-28 16:24:51 +08:00
feat: 国产某聊天软件的图床支持
This commit is contained in:
parent
7df870e65d
commit
ad543dd738
@ -83,6 +83,22 @@ async def _(bot: T_Bot, event: T_MessageEvent):
|
||||
ulang = get_user_lang(str(event.user_id))
|
||||
origins = ["origin", "origin2"]
|
||||
repo = Repo(".")
|
||||
|
||||
# Get the current HEAD commit
|
||||
current_head_commit = repo.head.commit
|
||||
|
||||
# Fetch the latest information from the cloud
|
||||
repo.remotes.origin.fetch()
|
||||
|
||||
# Get the latest HEAD commit
|
||||
new_head_commit = repo.commit('origin/main')
|
||||
|
||||
# If the new HEAD commit is different from the current HEAD commit, there is a new commit
|
||||
diffs = current_head_commit.diff(new_head_commit)
|
||||
logs = ""
|
||||
for diff in diffs.iter_change_type('M'):
|
||||
logs += f"\n{diff.a_path}"
|
||||
|
||||
for origin in origins:
|
||||
try:
|
||||
repo.remotes[origin].pull()
|
||||
|
Loading…
Reference in New Issue
Block a user