mirror of
https://github.com/TeamPGM/PagerMaid_Plugins.git
synced 2024-11-21 23:55:34 +00:00
✨ 捐赠用户对接功能 (#70)
This commit is contained in:
parent
b496963ec7
commit
260d5c58f5
10
list.json
10
list.json
@ -329,6 +329,16 @@
|
||||
"supported": true,
|
||||
"des-short": "贴纸转图片",
|
||||
"des": "把别人发的贴纸转换成图片(只支持静态)。命令:pic。"
|
||||
},
|
||||
{
|
||||
"name": "vip",
|
||||
"version": "0.1",
|
||||
"section": "chat",
|
||||
"maintainer": "xtaodada",
|
||||
"size": "4.0 kb",
|
||||
"supported": true,
|
||||
"des-short": "vip 捐赠用户功能",
|
||||
"des": "命令:天气:weather 。"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ push_content['chat_id'] = '-1001441461877'
|
||||
push_content['disable_web_page_preview'] = 'True'
|
||||
push_content['parse_mode'] = 'markdown'
|
||||
push_content['text'] = "#更新日志 #" + main['commit']['author'][
|
||||
'name'] + ' \n\n🔨 [' + main['sha'][0:7] + '](https://github.com/xtaodada/PagerMaid_Plugins/compare/' + \
|
||||
'name'].replace('_', '') + ' \n\n🔨 [' + main['sha'][0:7] + '](https://github.com/xtaodada/PagerMaid_Plugins/compare/' + \
|
||||
main[
|
||||
'sha'] + '): ' + main['commit']['message']
|
||||
url = 'https://api.telegram.org/bot' + token + '/sendMessage'
|
||||
|
20
vip.py
Normal file
20
vip.py
Normal file
@ -0,0 +1,20 @@
|
||||
from pagermaid import bot
|
||||
from pagermaid.listener import listener
|
||||
from pagermaid.utils import obtain_message
|
||||
|
||||
@listener(is_plugin=True, outgoing=True, command="weather",
|
||||
description="使用彩云天气 api 查询国内实时天气。",
|
||||
parameters="<城市>")
|
||||
async def weather(context):
|
||||
await context.edit("获取中 . . .")
|
||||
try:
|
||||
message = await obtain_message(context)
|
||||
except ValueError:
|
||||
await context.edit("出错了呜呜呜 ~ 无效的参数。")
|
||||
return
|
||||
async with bot.conversation('PagerMaid_Modify_bot') as conversation:
|
||||
await conversation.send_message('/weather ' + message)
|
||||
chat_response = await conversation.get_response()
|
||||
await bot.send_read_acknowledge(conversation.chat_id)
|
||||
weather_text = chat_response.text
|
||||
await context.edit(weather_text)
|
Loading…
Reference in New Issue
Block a user