From 8f2ad079ef9f7295c6972234c2654cc8abe5a0f9 Mon Sep 17 00:00:00 2001 From: xtaodada Date: Tue, 24 Aug 2021 22:36:34 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20sticker=20fix=20a=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pagermaid/modules/sticker.py | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/pagermaid/modules/sticker.py b/pagermaid/modules/sticker.py index 1db3af7..9dc6cbf 100644 --- a/pagermaid/modules/sticker.py +++ b/pagermaid/modules/sticker.py @@ -118,21 +118,22 @@ async def sticker(context): return # 是否添加到指定贴纸包 - if context.parameter[0] == "to": - if len(context.parameter) == 2: - to_sticker_set = context.parameter[1] - if redis_status(): - redis.set("sticker.to", to_sticker_set) - else: - if redis_status(): - if redis.get("sticker.to"): - to_sticker_set = redis.get("sticker.to").decode() + if len(context.parameter) >= 1: + if context.parameter[0] == "to": + if len(context.parameter) == 2: + to_sticker_set = context.parameter[1] + if redis_status(): + redis.set("sticker.to", to_sticker_set) + else: + if redis_status(): + if redis.get("sticker.to"): + to_sticker_set = redis.get("sticker.to").decode() + else: + await context.edit(lang("sticker_to_no")) + return else: await context.edit(lang("sticker_to_no")) return - else: - await context.edit(lang("sticker_to_no")) - return user = await bot.get_me() if not user.username: