Skip to content

Commit

Permalink
Merge branch 'master' into merge-conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
ZoruaFox committed Aug 30, 2024
2 parents 0fc021a + 52c5d97 commit 53f9285
Show file tree
Hide file tree
Showing 51 changed files with 485 additions and 290 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/update-poetry-dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: '3.12'

- name: Install Poetry
run: |
curl -sSL "https://install.python-poetry.org" | python3 -
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/weekly-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
with:
ref: master

- uses: rui-costa/action-automatic-semver-releases@v1
- uses: rui-costa/action-automatic-semver-releases@1.1.1
with:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
SEMVER: PATCH
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 说明
本项目为Teahouse/akari-bot的分支项目,对比原始项目存在对TOS、模块i18n等部分的自定义,并包括了一个研究中的原神模块。

原项目说明见下

<div align="center">
<img width="256" src="./assets/character_marked.png" alt="logo">

Expand Down
Binary file added assets/Hack-Regular.ttf
Binary file not shown.
Binary file added assets/LXGWWenKai-Bold.ttf
Binary file not shown.
Binary file added assets/LXGWWenKai-Light.ttf
Binary file not shown.
Binary file added assets/LXGWWenKai-Regular.ttf
Binary file not shown.
Binary file added assets/LXGWWenKaiMono-Bold.ttf
Binary file not shown.
Binary file added assets/LXGWWenKaiMono-Light.ttf
Binary file not shown.
Binary file added assets/LXGWWenKaiMono-Regular.ttf
Binary file not shown.
4 changes: 2 additions & 2 deletions bots/aiogram/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@

@dp.message()
async def msg_handler(message: types.Message):
target_id = f'Telegram|{message.chat.type.title()}|{message.chat.id}'
target_id = f'Telegram|{message.chat.type}|{message.chat.id}'
reply_id = None
if message.reply_to_message:
reply_id = message.reply_to_message.message_id
msg = MessageSession(MsgInfo(target_id=target_id,
sender_id=f'Telegram|User|{message.from_user.id}',
target_from=f'Telegram|{message.chat.type.title()}',
target_from=f'Telegram|{message.chat.type}',
sender_from='Telegram|User', sender_name=message.from_user.username,
client_name=client_name,
message_id=message.message_id,
Expand Down
4 changes: 2 additions & 2 deletions bots/aiogram/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,12 @@ async def send_message(self, message_chain, quote=True, disable_secret_check=Fal

async def check_native_permission(self):
if not self.session.message:
chat = await bot.get_chat(self.session.target)
chat = await dp.bot.get_chat(self.session.target)
else:
chat = self.session.message.chat
if chat.type == 'private':
return True
admins = [member.user.id for member in await bot.get_chat_administrators(chat.id)]
admins = [member.user.id for member in await dp.bot.get_chat_administrators(chat.id)]
if self.session.sender in admins:
return True
return False
Expand Down
2 changes: 2 additions & 0 deletions bots/kook/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@
@bot.on_message((MessageTypes.TEXT, MessageTypes.IMG))
async def msg_handler(message: Message):
if message.channel_type.name == "GROUP":

target_id = f'KOOK|Group|{message.target_id}'
else:
target_id = f'KOOK|{message.channel_type.name.title()}|{message.author_id}'

reply_id = None
if 'quote' in message.extra:
reply_id = message.extra['quote']['rong_id']
Expand Down
2 changes: 1 addition & 1 deletion bots/kook/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ async def send_message(self, message_chain, quote=True, disable_secret_check=Fal
msg_ids.append(x['msg_id'])
if callback:
MessageTaskManager.add_callback(x['msg_id'], callback)
return FinishedSession(self, msg_ids, {self.session.message.channel_type.name.title(): send})
return FinishedSession(self, msg_ids, {self.session.message.channel_type.name: send})

async def check_native_permission(self):
self.session.message: Message
Expand Down
Loading

0 comments on commit 53f9285

Please sign in to comment.