ignore list updates when nick changes.
This commit is contained in:
		
							
								
								
									
										10
									
								
								bot.sh
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								bot.sh
									
									
									
									
									
								
							| @@ -44,6 +44,16 @@ tail -f "$input" | telnet "$server" "$port" | while read -r result ; do | ||||
|     echo "$(date "+[$dateFormat]") $result" >> "$log" | ||||
|     # do things when you see output | ||||
|     case "$result" in | ||||
|         # Handle nick changes | ||||
|         ":"*"NICK :"*) | ||||
|             # Get the original nick | ||||
|             originalNick="${result#:}" | ||||
|             originalNick="${originalNick%%!*}" | ||||
|             # If the old nick was in the ignore list, update it. | ||||
|             if [[ "${originalNick}" =~ [${ignoreList}] ]]; then | ||||
|                 export ignoreList="${ignoreList/${originalNick}/${result#:*:}}" | ||||
|             fi | ||||
|         ;; | ||||
|         # respond to ping requests from the server | ||||
|         PING*) | ||||
|             echo "${result/I/O}" >> "$input" | ||||
|   | ||||
		Reference in New Issue
	
	Block a user