소스 검색

!neighbours: filter duplicate outputs

This can happen when BATMAN displays multiple MACs of neighbouring nodes.
Helge Jung 9 년 전
부모
커밋
452014f30f
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  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))