diff --git a/plugins_new/music_163/plugin.py b/plugins_new/music_163/plugin.py index 1d72a2a020df172ce666e011b2d18668c5dda414..50ea45ba352c121dad1d7b1f662dd560a6694424 100644 --- a/plugins_new/music_163/plugin.py +++ b/plugins_new/music_163/plugin.py @@ -29,7 +29,6 @@ class Music163Plugin(Plugin): "password": self.config.PASSWORD }) as resp: result = await resp.json() - self.bot.logger.debug(f"Login response: {result}") return result["code"] == 200 elif self.config.LOGIN_MODE == "email": async with self.aioclient.get(f"{self.config.API_URL}/login", params={ @@ -37,7 +36,6 @@ class Music163Plugin(Plugin): "password": self.config.PASSWORD }) as resp: result = await resp.json() - self.bot.logger.debug(f"Login response: {result}") return result["code"] == 200 else: return False @@ -47,7 +45,6 @@ class Music163Plugin(Plugin): return True async with self.aioclient.get(f"{self.config.API_URL}/login/refresh") as resp: result = await resp.json() - self.bot.logger.debug(f"") return result["code"] == 200 async def check_music_available(self, music_id: int) -> bool: @@ -75,8 +72,10 @@ class Music163Plugin(Plugin): return result["result"]["songs"] async def command_music(self, plugin, args: List[str], raw_string: str, context, evt: GroupMessageEvent): - # while not args[-1]: - # del args[-1] + if len(args) == 0: + await self.bot.client_async.send(context, "输入不合法") + return + raw = False link = False if args[-1] == "raw": @@ -86,9 +85,13 @@ class Music163Plugin(Plugin): link = True del args[-1] + if len(args) == 0: + await self.bot.client_async.send(context, "输入不合法") + return + if not await self.check_login_status(): if not await self.login(): - await self.bot.client_async.send(context, "网易云账号登陆失败!") + await self.bot.client_async.send(context, "网易云账号登陆失败, 请检查账号密码!") elif not await self.check_login_status(): await self.bot.client_async.send(context, "网易云账号登陆失败!") diff --git a/requires.txt b/requires.txt index 99b1ec19727b9fd11778775fc52732b71829ac30..2ef5b5a05dbf0545fc8229f04b774e0f04f4c069 100644 --- a/requires.txt +++ b/requires.txt @@ -18,4 +18,5 @@ jieba aiohttp aiofiles ujson -graphviz \ No newline at end of file +dnspython +graphviz