From 5c04749c377d6e249bd735a9c2434d50153b122f Mon Sep 17 00:00:00 2001 From: xtaodada Date: Sun, 12 Dec 2021 13:24:40 +0800 Subject: [PATCH] =?UTF-8?q?neteasedown=20rape=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- list.json | 4 ++-- neteasedown.py | 4 ++-- rape.py | 3 +++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/list.json b/list.json index 03f8b31..f76f9df 100644 --- a/list.json +++ b/list.json @@ -272,7 +272,7 @@ }, { "name": "neteasedown", - "version": "1.222", + "version": "1.223", "section": "daily", "maintainer": "xtaodada", "size": "11.4 kb", @@ -472,7 +472,7 @@ }, { "name": "rape", - "version": "1.031", + "version": "1.032", "section": "chat", "maintainer": "Pentacene", "size": "4.0 kb", diff --git a/neteasedown.py b/neteasedown.py index a796e92..d7c5050 100644 --- a/neteasedown.py +++ b/neteasedown.py @@ -213,13 +213,13 @@ async def ned(context): # 搜索歌曲 # 判断是否使用最高比特率解析 flac_mode = True if context.arguments.find("-f") != -1 else False - song_id = context.arguments.replace("-f", "").strip() + song_id = context.arguments.replace("-f", "").replace("\u200b", "").strip() # id if song_id.isdigit(): song_id = int(song_id) else: search_data = apis.cloudsearch.GetSearchResult(song_id, CloudSearchType(1), 1) - if len(search_data["result"]["songs"]) == 1: + if search_data["result"]["songCount"] >= 1: song_id = search_data["result"]["songs"][0]["id"] else: await context.edit(f"**没有找到歌曲**,请检查歌曲名称是否正确。") diff --git a/rape.py b/rape.py index bdc8c90..91e7efc 100644 --- a/rape.py +++ b/rape.py @@ -39,6 +39,9 @@ async def rape(context): except ChatAdminRequiredError: await context.edit('无管理员权限。') return + except: + await context.edit('无法踢出。') + return await context.client.send_message( context.chat_id, f'[{reply.sender.first_name} {reply_last_name}](tg://user?id={reply.sender.id}) 已被移出群聊',