From c547651e966c30aa564e9a4e5c53c83f11168128 Mon Sep 17 00:00:00 2001 From: Dipesh Amin Date: Wed, 31 Aug 2011 23:45:44 +0100 Subject: add command !tradestate --- main.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/main.py b/main.py index 4fb53b7..602afeb 100755 --- a/main.py +++ b/main.py @@ -223,6 +223,20 @@ def process_whisper(nick, msg, mapserv): if not items_found: mapserv.sendall(whisper(nick, "Item not found.")) + elif msg == '!tradestate': + # Admin command - return trade state. + if user == -10: + return + + if int(user.get("accesslevel")) != 20: + mapserv.sendall(whisper(nick, "You don't have the correct permissions.")) + return + + if not trader_state.Trading.test(): + mapserv.sendall(whisper(nick, "I'm busy with a trade.")) + else: + mapserv.sendall(whisper(nick, "I'm free.")) + elif msg == '!listusers': # Admin command - shows a list of all user. if user == -10: -- cgit v1.2.3-70-g09d2