summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDipesh Amin <yaypunkrock@gmail.com>2011-08-31 23:45:44 +0100
committerDipesh Amin <yaypunkrock@gmail.com>2011-08-31 23:45:44 +0100
commitc547651e966c30aa564e9a4e5c53c83f11168128 (patch)
tree89394b471a255e50025fe50bb2720942e11fc05b
parent8cbc1eadd27e0bcb9f12ded7e1670509ee69fda3 (diff)
downloadmanamarket-c547651e966c30aa564e9a4e5c53c83f11168128.tar.gz
manamarket-c547651e966c30aa564e9a4e5c53c83f11168128.tar.bz2
manamarket-c547651e966c30aa564e9a4e5c53c83f11168128.tar.xz
manamarket-c547651e966c30aa564e9a4e5c53c83f11168128.zip
add command !tradestate
-rwxr-xr-xmain.py14
1 files changed, 14 insertions, 0 deletions
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: