mirror of
https://github.com/TeamPGM/PagerMaid_Plugins.git
synced 2024-11-25 12:17:50 +00:00
✨ keyword maf 函数支持使用者触发关键词时回复其他用户 (#129)
This commit is contained in:
parent
5d392dd21c
commit
08f478f4dc
@ -12,11 +12,17 @@ async def del_msg(context, t):
|
|||||||
async def main(context, text, tgurl, mode=0, re=1, t=-1):
|
async def main(context, text, tgurl, mode=0, re=1, t=-1):
|
||||||
ids = tgurl.split("/")[-2:]
|
ids = tgurl.split("/")[-2:]
|
||||||
message = await context.client.get_messages(int(ids[0]), ids=int(ids[1]))
|
message = await context.client.get_messages(int(ids[0]), ids=int(ids[1]))
|
||||||
|
re_id = context.id
|
||||||
try:
|
try:
|
||||||
data = message.photo
|
data = message.photo
|
||||||
except:
|
except:
|
||||||
data = message.media.document
|
data = message.media.document
|
||||||
sent = await context.client.send_message(context.chat_id, text, file=data, force_document=mode, reply_to=(context.id if re else None))
|
if context.is_reply:
|
||||||
|
me = await context.client.get_me()
|
||||||
|
if context.sender.id == me.id:
|
||||||
|
msg = await context.get_reply_message()
|
||||||
|
re_id = msg.id
|
||||||
|
sent = await context.client.send_message(context.chat_id, text, file=data, force_document=mode, reply_to=(re_id if re else None))
|
||||||
if t >= 0:
|
if t >= 0:
|
||||||
await del_msg(sent, t)
|
await del_msg(sent, t)
|
||||||
return ""
|
return ""
|
||||||
|
Loading…
Reference in New Issue
Block a user