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