捐赠用户对接功能 (#70)

This commit is contained in:
Xtao_dada 2020-11-14 20:38:20 +08:00 committed by GitHub
parent b496963ec7
commit 260d5c58f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 31 additions and 1 deletions

View File

@ -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 。"
}
]
}

View File

@ -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
View 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)