From be2e44bc967f6408b24d6ca9c469c82db81dcba3 Mon Sep 17 00:00:00 2001 From: Richard Chien Date: Sat, 22 Dec 2018 21:22:58 +0800 Subject: [PATCH] Remove "switch" command --- none/plugins/base.py | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/none/plugins/base.py b/none/plugins/base.py index 5342a8df..aede4735 100644 --- a/none/plugins/base.py +++ b/none/plugins/base.py @@ -1,8 +1,5 @@ -import asyncio - from none import on_command, CommandSession, permission as perm -from none.command import kill_current_session -from none.message import unescape, Message, handle_message +from none.message import unescape @on_command('echo') @@ -11,18 +8,6 @@ async def echo(session: CommandSession): @on_command('say', permission=perm.SUPERUSER) -async def _(session: CommandSession): +async def say(session: CommandSession): await session.send( unescape(session.get_optional('message') or session.current_arg)) - - -@on_command('switch', privileged=True) -async def _(session: CommandSession): - kill_current_session(session.bot, session.ctx) - - msg = Message(session.current_arg) - await session.send(msg) - - ctx = session.ctx.copy() - ctx['message'] = msg - asyncio.ensure_future(handle_message(session.bot, ctx))