2022-04-02 23:05:18 +08:00

17 lines
458 B
Python

import hoshino
from hoshino.typing import CQEvent
from hoshino.util import filt_message
from . import *
from .run import *
HELP_MSG = '''
1.[code [语言] (-i) (输入) 代码] :在线运行代码
'''
sv = hoshino.Service('code', bundle='详细', help_=HELP_MSG, enable_on_default=False)
@sv.on_prefix('code')
async def code(bot, ev: CQEvent):
res = await run(ev.message.extract_plain_text())
await bot.send(ev, filt_message(res), at_sender=True)