Merge pull request #29 from TNTcraftHIM/master

neteasemusic小bug修复
This commit is contained in:
Pentacene 2020-08-26 18:44:11 +08:00 committed by GitHub
commit c063ff0ece
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 6 deletions

View File

@ -282,10 +282,10 @@
}, },
{ {
"name": "neteasemusic", "name": "neteasemusic",
"version": "1.1", "version": "1.2",
"section": "daily", "section": "daily",
"maintainer": "TNTcraftHIM", "maintainer": "TNTcraftHIM",
"size": "9.9 kb", "size": "10.0 kb",
"supported": true, "supported": true,
"des-short": "网易云点歌", "des-short": "网易云点歌",
"des": "可以在线搜索并且快速点歌歌曲信息齐全支持直接回复点歌。命令nem。" "des": "可以在线搜索并且快速点歌歌曲信息齐全支持直接回复点歌。命令nem。"

View File

@ -145,8 +145,11 @@ async def nem(context):
f.write(music.content) f.write(music.content)
if (path.getsize(name) / 1024) < 100: if (path.getsize(name) / 1024) < 100:
remove(name) remove(name)
try:
if reply.sender.is_self: if reply.sender.is_self:
await reply.delete() await reply.delete()
except:
pass
await context.delete() await context.delete()
res = '你可以点击<a href="https://music.163.com/#/song?id=' + \ res = '你可以点击<a href="https://music.163.com/#/song?id=' + \
str(info['id']) + '">' + \ str(info['id']) + '">' + \
@ -168,8 +171,11 @@ async def nem(context):
caption=cap, caption=cap,
link_preview=False, link_preview=False,
force_document=False) force_document=False)
try:
if reply.sender.is_self: if reply.sender.is_self:
await reply.delete() await reply.delete()
except:
pass
try: try:
remove(name) remove(name)
except: except: