Herta-villa / Herta-villa-SDK

大别野「黑塔」Python SDK
MIT License
8 stars 1 forks source link

:sparkles: 消息匹配 #2

Closed MingxuanGame closed 1 year ago

MingxuanGame commented 1 year ago
from hertavilla import VillaBot, SendMessageEvent, run

bot = VillaBot(
    "",
    "",
    "/",
)

@bot.regex("\/(.*)+")
async def _(event: SendMessageEvent, bot: VillaBot):
    message = event.message
    if str(message[1]) == "/image":
        await bot.send(...)
    if str(message[1]) == "/post":
        await bot.send(...)

run(bot)