Some new things

This commit is contained in:
Richard Chien
2018-06-24 23:00:37 +08:00
parent 4bc2b3c979
commit 8faee1151f
2 changed files with 30 additions and 11 deletions

View File

@ -2,14 +2,21 @@ from aiocqhttp.message import unescape
import none
from none import permissions as perm
from none.command import Session
from none.helpers import send
@none.on_command('echo')
async def _(bot, ctx, session):
await send(bot, ctx, session.arg)
async def echo(bot, ctx, session: Session):
text = session.require_arg('text')
await send(bot, session.ctx, text)
@echo.argparser
def _(session: Session):
session.args['text'] = session.current_arg
@none.on_command('say', permission=perm.SUPERUSER)
async def _(bot, ctx, session):
await send(bot, ctx, unescape(session.arg))
async def _(bot, ctx, session: Session):
await send(bot, session.ctx, unescape(session.current_arg))