diff options
author | Dipesh Amin <yaypunkrock@gmail.com> | 2011-09-09 17:09:24 +0100 |
---|---|---|
committer | Dipesh Amin <yaypunkrock@gmail.com> | 2011-09-09 17:09:24 +0100 |
commit | d3e9149e64ba85b0db120d721891f6be457f7fab (patch) | |
tree | f20bcc1888603e664ca5393873b6059278588e59 | |
parent | b2cc60c0e414320673e1a33bcc332484335090aa (diff) | |
download | manamarket-d3e9149e64ba85b0db120d721891f6be457f7fab.tar.gz manamarket-d3e9149e64ba85b0db120d721891f6be457f7fab.tar.bz2 manamarket-d3e9149e64ba85b0db120d721891f6be457f7fab.tar.xz manamarket-d3e9149e64ba85b0db120d721891f6be457f7fab.zip |
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.
-rwxr-xr-x | main.py | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -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: |