feat: Automatically use the at me list when the number of at all is insufficient or the bot is not an administrator

This commit is contained in:
LWR
2023-02-05 19:48:22 +08:00
parent 06d6b4eced
commit 4f7b48ddae
7 changed files with 108 additions and 73 deletions
+1 -1
View File
@@ -23,7 +23,7 @@ async def send(request: aiohttp.web.Request) -> aiohttp.web.Response:
target = datasource.get_target_by_key(key)
bot = datasource.get_bot_by_key(key)
msg = Message(id=target.id, content=message, type=target.type)
bot.send_message(msg)
await bot.send_message(msg)
return web.Response(text="success")
except DataSourceException:
logger.warning(f"HTTP API 推送失败, 不存在的推送 key: {key}")