Skip to content

Commit

Permalink
upd
Browse files Browse the repository at this point in the history
  • Loading branch information
DoroWolf authored Mar 22, 2024
1 parent 55b42dd commit c174c4e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
11 changes: 6 additions & 5 deletions bots/lagrange/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,12 @@ async def _(event: Event):
@bot.on_message('group')
async def _(event: Event):
if Config('qq_group_allow_list'):
result = BotDBUtil.isGroupInAllowList(f'QQ|Group|{str(event.group_id)}')
if not result:
await bot.send(event=event, message='此群不在白名单中,已自动退群。'
'\n如需申请白名单,请至https://github.com/Teahouse-Studios/bot/issues/new/choose发起issue。')
result = BotDBUtil.GroupBlockList.check(f'QQ|Group|{str(event.group_id)}')
if result:
res = Locale(lang).t('qq.message.in_group_blocklist')
if Config('issue_url'):
res += '\n' + Locale(lang).t('tos.message.appeal', issue_url=Config('issue_url'))
await bot.send(event=event, message=str(res))
await bot.call_action('set_group_leave', group_id=event.group_id)
"""

Expand Down
1 change: 1 addition & 0 deletions locales/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"error.prompt.address": "Report this issue: ${url}",
"error.prompt.noreport": "An error occurred while executing the command:\n${detail}\nThis error is not caused by the bot (e.g. the API request went wrong) and thus should not be reported to developers.",
"example": "Hello world!",
"qq.message.in_group_blocklist": "This group is in group blocklist, automatically left.",
"failed": "Failed.",
"game.help.stop": "Stop the current game.",
"game.message.running": "This game is currently in progress.",
Expand Down
5 changes: 3 additions & 2 deletions locales/zh_tw.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@
"message.delimiter": "",
"message.embed.author": "作者:",
"message.end": "",
"message.id.invalid.sender": "ID 格式錯誤,格式應為「${sender}|<使用者 ID>」。",
"message.id.invalid.target": "ID 格式錯誤,格式應為「${target}|<對話 ID>」。",
"message.reply.prompt": "(請使用指定的詞語回覆此訊息)",
"message.wait.prompt.confirm": "(傳送「是」或符合確認條件的詞語確認)",
"message.wait.prompt.next_message": "(傳送符合條件的詞語確認)",
"message.id.invalid.sender": "ID 格式錯誤,格式應為「${sender}|<使用者 ID>」。",
"message.id.invalid.target": "ID 格式錯誤,格式應為「${target}|<對話 ID>」。",
"no": "",
"none": "",
"parser.admin.module.permission.denied": "「${module}」模組下的指令僅能由該群組的管理員所使用,請聯絡管理員執行此指令。",
Expand All @@ -65,6 +65,7 @@
"qq.message.disable_friend_request": "你好!本機器人不主動同意好友請求,請聯絡開發人員添加好友。",
"qq.message.disable_group_invite": "你好!本機器人不主動同意入群請求,請聯絡開發人員邀請加入群組。",
"qq.message.disable_temp_session": "請先添加好友後再進行命令交互。",
"qq.message.in_group_blocklist": "此群組在黑名單中,已自動退出。",
"success": "成功。",
"time.date.format": "%Y 年 %m 月 %d 日",
"time.date.iso.format": "%Y-%m-%d",
Expand Down

0 comments on commit c174c4e

Please sign in to comment.