From d3e9149e64ba85b0db120d721891f6be457f7fab Mon Sep 17 00:00:00 2001 From: Dipesh Amin Date: Fri, 9 Sep 2011 17:09:24 +0100 Subject: Add a command to identify who is selling an item. This is an admin command to be used when someone is selling something at a joke price, or something that will be too heavy. This is mainly so even people who can't read the logs can help to stop people from missusing it. --- main.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/main.py b/main.py index 6c3c154..707a02d 100755 --- a/main.py +++ b/main.py @@ -245,6 +245,27 @@ def process_whisper(nick, msg, mapserv): else: mapserv.sendall(whisper(nick, "I'm free.")) + elif broken_string[0] == '!identify': + if user == -10: + mapserv.sendall(whisper(nick, "You don't have the correct permissions.")) + return + elif len(broken_string) != 2: + mapserv.sendall(whisper(nick, "Syntax incorrect.")) + return + elif int(user.get("accesslevel")) < 10: + mapserv.sendall(whisper(nick, "You don't have the correct permissions.")) + return + + if broken_string[1].isdigit(): + uid = int(broken_string[1]) + item_info = sale_tree.get_uid(uid) + + if item_info == -10: + mapserv.sendall(whisper(nick, "Item not found. Please check the uid number and try again.")) + return + + mapserv.sendall(whisper(nick, "That item belongs to: "+item_info.get("name"))) + elif msg == '!listusers': # Admin command - shows a list of all user. if user == -10: -- cgit v1.2.3-70-g09d2