Browse Source

ffpb: add \!alfred-data command for admins

Helge Jung 10 years ago
parent
commit
ede204504a
1 changed files with 16 additions and 0 deletions
  1. 16 0
      modules/ffpb.py

+ 16 - 0
modules/ffpb.py

@@ -251,6 +251,22 @@ def ffpb_debug_alfred(bot, trigger):
 	else:
 		bot.say("ALFRED Daten: count={0} lastupdate={1}".format(len(alfred_data), alfred_update))
 
+@willie.module.commands('alfred-data')
+def ffpb_peerdata(bot, trigger):
+	if (not trigger.admin):
+		bot.say('I wont leak (possibly) sensitive data to you.')
+		return
+
+	if (not trigger.is_privmsg) and (not trigger.nick in bot.ops[trigger.sender]):
+		bot.say('Kein Keks? Keine Daten.')
+		return
+
+	target_name = trigger.group(2)
+	node = ffpb_findnode_from_botparam(bot, target_name)
+	if node is None: return
+
+	bot.say(str(node))
+
 @willie.module.commands('info')
 def ffpb_peerinfo(bot, trigger):
 	target_name = trigger.group(2)