From 26bbc145d303e5fd41d64a0d0ba40c5cb5bdc3d4 Mon Sep 17 00:00:00 2001 From: xtaodada Date: Tue, 24 Aug 2021 14:56:42 +0800 Subject: [PATCH] denyu groupindex fix a bug --- denyu.py | 6 +++++- groupindex.py | 6 +++++- list.json | 4 ++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/denyu.py b/denyu.py index 928b915..c98e355 100644 --- a/denyu.py +++ b/denyu.py @@ -24,7 +24,11 @@ async def denyu(context): if not reply_to_msg: await context.edit("在某群中强制禁言某用户,需要删除他人消息权限,需要 redis。用法:回复某条消息,格式为 `-denyu `") return - uid = reply_to_msg.sender.id + try: + uid = reply_to_msg.sender.id + except AttributeError: + await context.edit("出错了呜呜呜 ~ 无法读取用户 id") + return offset = 1 else: uid = context.parameter[0] diff --git a/groupindex.py b/groupindex.py index 52852e2..8e94ece 100644 --- a/groupindex.py +++ b/groupindex.py @@ -12,7 +12,11 @@ async def group_index(context): await context.edit('请在群组中运行。') return # 获取群组信息 - title = context.chat.title + try: + title = context.chat.title + except AttributeError: + await context.edit('读取群组信息失败。') + return end_id = context.id text = f'以下是群组 {title} 今日的活跃数据:\n' diff --git a/list.json b/list.json index 0e1e54a..37a02be 100644 --- a/list.json +++ b/list.json @@ -122,7 +122,7 @@ }, { "name": "denyu", - "version": "1.11", + "version": "1.111", "section": "chat", "maintainer": "fruitymelon", "size": "2.7 kb", @@ -692,7 +692,7 @@ }, { "name": "groupindex", - "version": "1.11", + "version": "1.12", "section": "daily", "maintainer": "xtaodada", "size": "3.2 kb",