Browse Source

!neighbours: filter duplicate outputs

This can happen when BATMAN displays multiple MACs of neighbouring nodes.
Helge Jung 9 years ago
parent
commit
452014f30f
1 changed files with 2 additions and 2 deletions
  1. 2 2
      modules/ffpb.py

+ 2 - 2
modules/ffpb.py

@@ -783,10 +783,10 @@ def ffpb_neighbours(bot, trigger):
 	d = '&'.join([ str(n) for n in cave_result ])
 	req = urllib2.urlopen('http://[fdca:ffee:ff12:a255::253]:8888/idmac2name', d)
 
-	neighbours = []
+	neighbours = set()
 	for n in req:
 		ident,name = n.strip().split('=')
-		neighbours.append(name)
+		neighbours.add(name)
 
 	bot.say('; '.join(neighbours))