mirror of
https://github.com/TeamPGM/PagerMaid_Plugins.git
synced 2024-11-22 06:32:47 +00:00
shift update
This commit is contained in:
parent
defd39485c
commit
2f8929c3e1
@ -722,7 +722,7 @@
|
||||
},
|
||||
{
|
||||
"name": "shift",
|
||||
"version": "1.01",
|
||||
"version": "1.02",
|
||||
"section": "daily",
|
||||
"maintainer": "xtaodada",
|
||||
"size": "5.3 kb",
|
||||
|
25
shift.py
25
shift.py
@ -25,10 +25,18 @@ async def shift_set(context):
|
||||
return
|
||||
# 检查来源频道
|
||||
try:
|
||||
channel = int(context.parameter[1])
|
||||
channel = await context.client.get_entity(int(context.parameter[1]))
|
||||
if not channel.broadcast:
|
||||
await context.edit("出错了呜呜呜 ~ 无法识别的来源对话。")
|
||||
return
|
||||
channel = channel.id
|
||||
except Exception:
|
||||
try:
|
||||
channel = (await context.client.get_entity(context.parameter[1])).id
|
||||
channel = await context.client.get_entity(context.parameter[1])
|
||||
if not channel.broadcast:
|
||||
await context.edit("出错了呜呜呜 ~ 无法识别的来源对话。")
|
||||
return
|
||||
channel = channel.id
|
||||
except Exception:
|
||||
await context.edit("出错了呜呜呜 ~ 无法识别的来源对话。")
|
||||
return
|
||||
@ -76,10 +84,18 @@ async def shift_set(context):
|
||||
return
|
||||
# 检查来源频道
|
||||
try:
|
||||
channel = int(context.parameter[1])
|
||||
channel = await context.client.get_entity(int(context.parameter[1]))
|
||||
if not channel.broadcast:
|
||||
await context.edit("出错了呜呜呜 ~ 无法识别的来源对话。")
|
||||
return
|
||||
channel = channel.id
|
||||
except Exception:
|
||||
try:
|
||||
channel = (await context.client.get_entity(context.parameter[1])).id
|
||||
channel = await context.client.get_entity(context.parameter[1])
|
||||
if not channel.broadcast:
|
||||
await context.edit("出错了呜呜呜 ~ 无法识别的来源对话。")
|
||||
return
|
||||
channel = channel.id
|
||||
except Exception:
|
||||
await context.edit("出错了呜呜呜 ~ 无法识别的来源对话。")
|
||||
return
|
||||
@ -120,7 +136,6 @@ async def shift_channel_message(context):
|
||||
if not redis.get("shift." + str(context.chat_id)):
|
||||
return
|
||||
if context.chat_id in [-1001441461877]:
|
||||
await context.edit('出错了呜呜呜 ~ 此对话位于白名单中。')
|
||||
return
|
||||
cid = int(redis.get("shift." + str(context.chat_id)).decode())
|
||||
try:
|
||||
|
Loading…
Reference in New Issue
Block a user