kexue-z / nonebot-plugin-setu-now

不可以涩涩
MIT License
128 stars 19 forks source link

禁用随机特效不能按预期工作 #40

Closed OREOCODEDEV closed 1 year ago

OREOCODEDEV commented 1 year ago

img_utils.py中randon_effect方法内

if effect:
    func = funcs[1][effect]
else:
    func = choices(population=funcs[1], weights=funcs[2], k=1)
output: Image.Image = func[0](_img)

当 effect == 0 时,会走else分支导致配置项setu_add_randon_effect不生效,且output赋值的索引[0]应该只对random.choices的结果进行索引,否则指定处理特效时会导致TypeError

kexue-z commented 1 year ago

立即PR

OREOCODEDEV commented 1 year ago

PR了,科佬康康有没有问题(