Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions COMMANDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -406,3 +406,11 @@ Moonlark 投票
- `/model <模型名> (更换默认模型)`
- `/model <模型名> <应用标识> (设置应用专用模型)`
- `/model :default: <应用标识> (删除应用配置)`
## `subaccount`: 管理子账号

[管理员专用] 管理子账号绑定关系:查看绑定状态、绑定/解绑子账号
> 此指令仅 Moonlark 管理员可用。
- `/subaccount view <用户ID> (查看绑定状态)`
- `/subaccount bind <子账号ID> <主账号ID> (绑定子账号)`
- `/subaccount unbind <子账号ID> (解绑子账号)`
- `/subaccount unbind <主账号ID> --all (解绑全部子账号)`
6 changes: 3 additions & 3 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 43 additions & 0 deletions src/lang/en_us/larkuser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,49 @@ help_setnick:
description: 修改昵称
details: "修改自己在 Moonlark 中的昵称,不带参数则解锁昵称锁定"
usage: "setnick <昵称> (修改昵称,不带参数解锁锁定)"
help_subaccount:
description: Manage Sub-Accounts
details: "[Admin] Manage sub-account bindings: view status, bind/unbind"
usage1: "subaccount view <user_id> (View binding status)"
usage2: "subaccount bind <sub_id> <main_id> (Bind sub-account)"
usage3: "subaccount unbind <sub_id> (Unbind sub-account)"
usage4: "subaccount unbind <main_id> --all (Unbind all sub-accounts)"

subaccount_admin:
permission_denied: "Permission denied. Only superusers can use this command."
usage: |
Usage:
subaccount view <user_id> - View binding status of the specified ID
subaccount bind <sub_id> <main_id> - Bind a sub-account to a main account
subaccount unbind <sub_id> - Unbind a sub-account from its main account
subaccount unbind <main_id> --all - Unbind all sub-accounts of a main account
view_is_sub: |
User {} ({}) is currently a sub-account
Main account: {} ({})
view_has_subs: |
User {} ({}) is a main account with {} sub-account(s):
{}
view_none: "User {} ({}) has no sub-account bindings and is not a sub-account."
bind_already_bound: |
Sub-account {} ({}) is already bound to main account {} ({})!
Please unbind first if you want to change.
bind_target_not_found: "Target main account {} does not exist in the system."
bind_confirm: |
Confirm binding sub-account {} ({}) to main account {} ({})?
confirm_prompt: "Please enter y/yes to confirm, or send q to cancel:"
bind_success: "Sub-account {} ({}) has been successfully bound to main account {} ({})."
unbind_not_bound: "User {} ({}) is not a sub-account."
unbind_confirm: |
Confirm unbinding sub-account {} ({}) from its main account {} ({})?
After unbinding, the sub-account will become independent.
unbind_success: "Sub-account {} ({}) has been successfully unbound from main account {} ({})."
unbind_all_no_subs: "User {} ({}) has no sub-accounts."
unbind_all_confirm: |
Confirm unbinding all {} sub-account(s) of main account {} ({})?
{}
After unbinding, all sub-accounts will become independent.
unbind_all_success: "Successfully unbound all {} sub-account(s) of main account {} ({})."

input:
user_nickname: |
Moonlark 没有办法读取您的展示名称(昵称)。请发送您的展示名称,也可以发送“q”留空。
Expand Down
42 changes: 42 additions & 0 deletions src/lang/zh_hans/larkuser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,48 @@ help_setnick:
description: 修改昵称
details: "修改自己在 Moonlark 中的昵称,不带参数则解锁昵称锁定"
usage: "setnick <昵称> (修改昵称,不带参数解锁锁定)"
help_subaccount:
description: 管理子账号
details: "[管理员专用] 管理子账号绑定关系:查看绑定状态、绑定/解绑子账号"
usage1: "subaccount view <用户ID> (查看绑定状态)"
usage2: "subaccount bind <子账号ID> <主账号ID> (绑定子账号)"
usage3: "subaccount unbind <子账号ID> (解绑子账号)"
usage4: "subaccount unbind <主账号ID> --all (解绑全部子账号)"
subaccount_admin:
permission_denied: "权限不足,只有超级管理员可以使用此命令。"
usage: |
用法:
subaccount view <用户ID> - 查看指定 ID 的绑定情况
subaccount bind <子账号ID> <主账号ID> - 将子账号绑定到主账号
subaccount unbind <子账号ID> - 解绑指定子账号的主账号
subaccount unbind <主账号ID> --all - 解绑指定主账号的所有子账号
view_is_sub: |
用户 {} ({}) 当前是子账号状态
主账号: {} ({})
view_has_subs: |
用户 {} ({}) 是主账号,有 {} 个子账号:
{}
view_none: "用户 {} ({}) 没有绑定任何子账号,也不是子账号。"
bind_already_bound: |
子账号 {} ({}) 已经绑定到主账号 {} ({}),无法重复绑定!
如需更改请先解绑。
bind_target_not_found: "目标主账号 {} 在系统中不存在,无法绑定。"
bind_confirm: |
确认将子账号 {} ({}) 绑定到主账号 {} ({}) 吗?
confirm_prompt: "请输入 y/是 确认,或发送 q 取消:"
bind_success: "子账号 {} ({}) 已成功绑定到主账号 {} ({})。"
unbind_not_bound: "用户 {} ({}) 不是子账号,无法解绑。"
unbind_confirm: |
确认将子账号 {} ({}) 从其主账号 {} ({}) 解绑吗?
解绑后,该子账号将恢复独立身份。
unbind_success: "子账号 {} ({}) 已成功从其主账号 {} ({}) 解绑。"
unbind_all_no_subs: "用户 {} ({}) 没有子账号,无需解绑。"
unbind_all_confirm: |
确认解绑主账号 {} ({}) 的所有 {} 个子账号吗?
{}
解绑后,这些子账号将全部恢复独立身份。
unbind_all_success: "已成功将主账号 {} ({}) 的 {} 个子账号全部解绑。"

input:
user_nickname: |
Moonlark 没有办法读取您的展示名称(昵称)。请发送您的展示名称,也可以发送“q”留空。
Expand Down
43 changes: 43 additions & 0 deletions src/lang/zh_tw/larkuser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,49 @@ help_setnick:
description: 修改昵称
details: "修改自己在 Moonlark 中的昵称,不带参数则解锁昵称锁定"
usage: "setnick <昵称> (修改昵称,不带参数解锁锁定)"
help_subaccount:
description: 管理子帳號
details: "[管理員專用] 管理子帳號綁定關係:查看綁定狀態、綁定/解綁子帳號"
usage1: "subaccount view <用戶ID> (查看綁定狀態)"
usage2: "subaccount bind <子帳號ID> <主帳號ID> (綁定子帳號)"
usage3: "subaccount unbind <子帳號ID> (解綁子帳號)"
usage4: "subaccount unbind <主帳號ID> --all (解綁全部子帳號)"

subaccount_admin:
permission_denied: "權限不足,只有超級管理員可以使用此命令。"
usage: |
用法:
subaccount view <用戶ID> - 查看指定 ID 的綁定情況
subaccount bind <子帳號ID> <主帳號ID> - 將子帳號綁定到主帳號
subaccount unbind <子帳號ID> - 解綁指定子帳號的主帳號
subaccount unbind <主帳號ID> --all - 解綁指定主帳號的所有子帳號
view_is_sub: |
用戶 {} ({}) 當前是子帳號狀態
主帳號: {} ({})
view_has_subs: |
用戶 {} ({}) 是主帳號,有 {} 個子帳號:
{}
view_none: "用戶 {} ({}) 沒有綁定任何子帳號,也不是子帳號。"
bind_already_bound: |
子帳號 {} ({}) 已經綁定到主帳號 {} ({}),無法重複綁定!
如需更改請先解綁。
bind_target_not_found: "目標主帳號 {} 在系統中不存在,無法綁定。"
bind_confirm: |
確認將子帳號 {} ({}) 綁定到主帳號 {} ({}) 嗎?
confirm_prompt: "請輸入 y/是 確認,或發送 q 取消:"
bind_success: "子帳號 {} ({}) 已成功綁定到主帳號 {} ({})。"
unbind_not_bound: "用戶 {} ({}) 不是子帳號,無法解綁。"
unbind_confirm: |
確認將子帳號 {} ({}) 從其主帳號 {} ({}) 解綁嗎?
解綁後,該子帳號將恢復獨立身份。
unbind_success: "子帳號 {} ({}) 已成功從其主帳號 {} ({}) 解綁。"
unbind_all_no_subs: "用戶 {} ({}) 沒有子帳號,無需解綁。"
unbind_all_confirm: |
確認解綁主帳號 {} ({}) 的所有 {} 個子帳號嗎?
{}
解綁後,這些子帳號將全部恢復獨立身份。
unbind_all_success: "已成功將主帳號 {} ({}) 的 {} 個子帳號全部解綁。"

input:
user_nickname: |
Moonlark 没有办法读取您的展示名称(昵称)。请发送您的展示名称,也可以发送“q”留空。
Expand Down
1 change: 1 addition & 0 deletions src/plugins/nonebot_plugin_larkuser/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@


from .matchers import recorder, panel, whoami, register, setnick
from .matchers import subaccount_admin
from .utils.matcher import patch_matcher
from .utils.level import get_level_by_experience
from .utils.user import get_user, MoonlarkUser, get_registered_users, get_registered_user_list, get_registered_user_ids
Expand Down
9 changes: 9 additions & 0 deletions src/plugins/nonebot_plugin_larkuser/help.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,12 @@ commands:
usages:
- help_setnick.usage
category: setting
subaccount:
description: help_subaccount.description
details: help_subaccount.details
usages:
- help_subaccount.usage1
- help_subaccount.usage2
- help_subaccount.usage3
- help_subaccount.usage4
category: superuser
Loading