diff --git a/test.py b/test.py new file mode 100644 index 0000000..992bb00 --- /dev/null +++ b/test.py @@ -0,0 +1,21 @@ +from worker import emmm + +print("开始测试咯,在 '>' 后面输入n你的消息,不用加 '/'") +inp = input('>') +while(inp): + parms = str.split(inp) + worker = parms[0] + + try: + package = __import__(name='worker.'+ worker, fromlist=worker) + Ans_ = getattr(package,'Ans') + except: + Ans_ = emmm.Ans + + try: + Ans = Ans_(parms,uid=0,gid=0,role='owner',raw_msg={'message':'/' + inp}) + Message = Ans.GETMSG() + except Exception as e: + Message = ' Error:\n'+e + print(Message) + inp = input('>') \ No newline at end of file diff --git a/worker/echo.py b/worker/echo.py new file mode 100644 index 0000000..3ddf3f9 --- /dev/null +++ b/worker/echo.py @@ -0,0 +1,13 @@ +import random +from zzcore import StdAns + +class Ans(StdAns): + def GETMSG(self): + r = random.randint(1,3) + if r == 1: + msg = self.raw_msg['message'][5:] + elif r == 2: + msg = "汝以为咱会复读的嘛!\n(╯' - ')╯︵ ┻━┻\n" + self.raw_msg['message'][5:] + elif r == 3: + msg = '咱才不做复读机。→_→' + return msg \ No newline at end of file