update pix

This commit is contained in:
HibiKier 2022-06-11 17:57:19 +08:00
parent 715338f821
commit 785179e4a7
2 changed files with 15 additions and 3 deletions

View File

@ -243,6 +243,10 @@ __Docker 最新版本由 [Sakuracio](https://github.com/Sakuracio) 提供__
## 更新
### 2022/6/11
* pix当只有一个tag时且为数字时可以通过添加'#'防止判定为数量
### 2022/6/9
* 修复b站订阅同群二人以上相同订阅时发送多次信息

View File

@ -20,6 +20,11 @@ usage
pix ?*[tags]: 通过 tag 获取相似图片不含tag时随机抽取
pid [uid]: 通过uid获取图片
pix pid[pid]: 查看图库中指定pid图片
示例pix 萝莉 白丝
示例pix 萝莉 白丝 10 10为数量
示例pix #02 当tag只有1个tag且为数字时使用#标记,否则将被判定为数量)
示例pix 34582394 查询指定uid图片
示例pix pid:12323423 查询指定pid图片
""".strip()
__plugin_superuser_usage__ = """
usage
@ -88,9 +93,12 @@ async def _(bot: Bot, event: MessageEvent, arg: Message = CommandArg()):
nsfw_tag == 2 and not Config.get_config("pix", "ALLOW_GROUP_R18")
):
await pix.finish("你不能看这些噢,这些都是是留给管理员看的...")
if n := len(x) == 1 and is_number(x[0]) and int(x[0]) < 100:
num = int(x[0])
keyword = ""
if n := len(x) == 1:
if is_number(x[0]) and int(x[0]) < 100:
num = int(x[0])
keyword = ""
elif x[0].startswith("#"):
keyword = x[0][1:]
elif n > 1:
if is_number(x[-1]):
num = int(x[-1])