17 lines
458 B
Python
Raw Normal View History

2022-03-13 21:25:42 +08:00
import hoshino
from hoshino.typing import CQEvent
2022-04-02 23:05:18 +08:00
from hoshino.util import filt_message
2022-03-13 21:25:42 +08:00
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())
2022-04-02 23:05:18 +08:00
await bot.send(ev, filt_message(res), at_sender=True)