mirror of
https://github.com/TeamPGM/PagerMaid_Plugins.git
synced 2024-11-25 12:17:50 +00:00
netease rape vip yvlu 修复错误
This commit is contained in:
parent
ac6cf7b671
commit
dbf85f32b4
@ -272,7 +272,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "neteasedown",
|
"name": "neteasedown",
|
||||||
"version": "1.223",
|
"version": "1.224",
|
||||||
"section": "daily",
|
"section": "daily",
|
||||||
"maintainer": "xtaodada",
|
"maintainer": "xtaodada",
|
||||||
"size": "11.4 kb",
|
"size": "11.4 kb",
|
||||||
@ -472,7 +472,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "rape",
|
"name": "rape",
|
||||||
"version": "1.032",
|
"version": "1.033",
|
||||||
"section": "chat",
|
"section": "chat",
|
||||||
"maintainer": "Pentacene",
|
"maintainer": "Pentacene",
|
||||||
"size": "4.0 kb",
|
"size": "4.0 kb",
|
||||||
@ -682,7 +682,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "yvlu",
|
"name": "yvlu",
|
||||||
"version": "1.21",
|
"version": "1.211",
|
||||||
"section": "chat",
|
"section": "chat",
|
||||||
"maintainer": "xtaodada",
|
"maintainer": "xtaodada",
|
||||||
"size": "10.4 kb",
|
"size": "10.4 kb",
|
||||||
|
@ -219,12 +219,12 @@ async def ned(context):
|
|||||||
song_id = int(song_id)
|
song_id = int(song_id)
|
||||||
else:
|
else:
|
||||||
search_data = apis.cloudsearch.GetSearchResult(song_id, CloudSearchType(1), 1)
|
search_data = apis.cloudsearch.GetSearchResult(song_id, CloudSearchType(1), 1)
|
||||||
if search_data["result"]["songCount"] >= 1:
|
if search_data.get("result", {}).get("songCount", 0) >= 1:
|
||||||
song_id = search_data["result"]["songs"][0]["id"]
|
song_id = search_data["result"]["songs"][0]["id"]
|
||||||
else:
|
else:
|
||||||
await context.edit(f"**没有找到歌曲**,请检查歌曲名称是否正确。")
|
await context.edit(f"**没有找到歌曲**,请检查歌曲名称是否正确。")
|
||||||
return
|
return
|
||||||
# 获取歌曲信息小于等于 320k HQ
|
# 获取歌曲质量是否大于 320k HQ
|
||||||
track_info = apis.track.GetTrackAudio([song_id], bitrate=3200 * 1000 if flac_mode else 320000)
|
track_info = apis.track.GetTrackAudio([song_id], bitrate=3200 * 1000 if flac_mode else 320000)
|
||||||
# 获取歌曲详情
|
# 获取歌曲详情
|
||||||
song_info = apis.track.GetTrackDetail([song_id])
|
song_info = apis.track.GetTrackDetail([song_id])
|
||||||
|
30
rape.py
30
rape.py
@ -20,10 +20,17 @@ async def rape(context):
|
|||||||
reply = await context.get_reply_message()
|
reply = await context.get_reply_message()
|
||||||
if context.is_group:
|
if context.is_group:
|
||||||
if reply:
|
if reply:
|
||||||
if reply.sender.last_name is None:
|
try:
|
||||||
reply_last_name = ''
|
if reply.sender.last_name is None:
|
||||||
else:
|
reply_last_name = ''
|
||||||
reply_last_name = reply.sender.last_name
|
else:
|
||||||
|
reply_last_name = reply.sender.last_name
|
||||||
|
except AttributeError:
|
||||||
|
try:
|
||||||
|
await context.edit('无法获取所回复的用户。')
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
return
|
||||||
if context.sender.last_name is None:
|
if context.sender.last_name is None:
|
||||||
context_last_name = ''
|
context_last_name = ''
|
||||||
else:
|
else:
|
||||||
@ -68,10 +75,17 @@ async def rape(context):
|
|||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
if context.sender.last_name is None:
|
try:
|
||||||
context_last_name = ''
|
if context.sender.last_name is None:
|
||||||
else:
|
context_last_name = ''
|
||||||
context_last_name = context.sender.last_name
|
else:
|
||||||
|
context_last_name = context.sender.last_name
|
||||||
|
except AttributeError:
|
||||||
|
try:
|
||||||
|
await context.edit('无法获取所回复的用户。')
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
return
|
||||||
if context.arguments == '':
|
if context.arguments == '':
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
|
6
vip.py
6
vip.py
@ -3,6 +3,7 @@ from redis.exceptions import ConnectionError
|
|||||||
from requests import get
|
from requests import get
|
||||||
from os import remove
|
from os import remove
|
||||||
from telethon.tl.types import MessageMediaPhoto
|
from telethon.tl.types import MessageMediaPhoto
|
||||||
|
from asyncio.exceptions import TimeoutError
|
||||||
from pagermaid import bot, redis, redis_status
|
from pagermaid import bot, redis, redis_status
|
||||||
from pagermaid.listener import listener
|
from pagermaid.listener import listener
|
||||||
from pagermaid.utils import obtain_message, alias_command
|
from pagermaid.utils import obtain_message, alias_command
|
||||||
@ -314,7 +315,10 @@ async def az_tts(context, mode):
|
|||||||
return
|
return
|
||||||
async with bot.conversation('PagerMaid_Modify_bot') as conversation:
|
async with bot.conversation('PagerMaid_Modify_bot') as conversation:
|
||||||
await conversation.send_message('/tts ' + message + mode)
|
await conversation.send_message('/tts ' + message + mode)
|
||||||
chat_response = await conversation.get_response()
|
try:
|
||||||
|
chat_response = await conversation.get_response()
|
||||||
|
except TimeoutError:
|
||||||
|
return await context.edit("未收到服务器回应。")
|
||||||
await bot.send_read_acknowledge(conversation.chat_id)
|
await bot.send_read_acknowledge(conversation.chat_id)
|
||||||
if reply:
|
if reply:
|
||||||
await context.respond(chat_response, reply_to=reply)
|
await context.respond(chat_response, reply_to=reply)
|
||||||
|
6
yvlu.py
6
yvlu.py
@ -8,6 +8,7 @@ from telethon.errors import YouBlockedUserError, ForbiddenError, FloodWaitError,
|
|||||||
from telethon.tl.functions.contacts import UnblockRequest
|
from telethon.tl.functions.contacts import UnblockRequest
|
||||||
from telethon.tl.functions.users import GetFullUserRequest
|
from telethon.tl.functions.users import GetFullUserRequest
|
||||||
from telethon.tl.types import MessageMediaPhoto, MessageMediaWebPage
|
from telethon.tl.types import MessageMediaPhoto, MessageMediaWebPage
|
||||||
|
from asyncio.exceptions import TimeoutError
|
||||||
from pagermaid import bot
|
from pagermaid import bot
|
||||||
from pagermaid.listener import listener
|
from pagermaid.listener import listener
|
||||||
from pagermaid.utils import alias_command
|
from pagermaid.utils import alias_command
|
||||||
@ -138,7 +139,10 @@ async def yv_lu(context):
|
|||||||
return await context.edit("无权限转发消息。")
|
return await context.edit("无权限转发消息。")
|
||||||
except:
|
except:
|
||||||
return await context.edit("未知错误。")
|
return await context.edit("未知错误。")
|
||||||
chat_response = await conversation.get_response(message=send_for.id)
|
try:
|
||||||
|
chat_response = await conversation.get_response(message=send_for.id)
|
||||||
|
except TimeoutError:
|
||||||
|
return await context.edit("未收到服务器回应。")
|
||||||
await bot.send_read_acknowledge(conversation.chat_id)
|
await bot.send_read_acknowledge(conversation.chat_id)
|
||||||
await bot.send_message(context.chat_id, chat_response, reply_to=context.message.reply_to_msg_id)
|
await bot.send_message(context.chat_id, chat_response, reply_to=context.message.reply_to_msg_id)
|
||||||
await context.delete()
|
await context.delete()
|
||||||
|
Loading…
Reference in New Issue
Block a user