mirror of
				https://github.com/fluffle/goirc
				synced 2025-10-31 10:18:04 +00:00 
			
		
		
		
	state: channel: add Nicks() and NicksStr() accessors for nicks on channel
This commit is contained in:
		
							parent
							
								
									aa021c7cac
								
							
						
					
					
						commit
						eb92a84e96
					
				
					 1 changed files with 18 additions and 0 deletions
				
			
		|  | @ -210,6 +210,24 @@ func (ch *Channel) ParseModes(modes string, modeargs ...string) { | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | // Nicks returns a list of *Nick that are on the channel. | ||||||
|  | func (ch *Channel) Nicks() []*Nick { | ||||||
|  | 	nicks := make([]*Nick, 0, len(ch.lookup)) | ||||||
|  | 	for _, nick := range ch.lookup { | ||||||
|  | 		nicks = append(nicks, nick) | ||||||
|  | 	} | ||||||
|  | 	return nicks | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | // NicksStr returns a list of nick strings that are on the channel. | ||||||
|  | func (ch *Channel) NicksStr() []string { | ||||||
|  | 	nicks := make([]string, 0, len(ch.lookup)) | ||||||
|  | 	for _, nick := range ch.lookup { | ||||||
|  | 		nicks = append(nicks, nick.Nick) | ||||||
|  | 	} | ||||||
|  | 	return nicks | ||||||
|  | } | ||||||
|  | 
 | ||||||
| // Returns a string representing the channel. Looks like: | // Returns a string representing the channel. Looks like: | ||||||
| //	Channel: <channel name> e.g. #moo | //	Channel: <channel name> e.g. #moo | ||||||
| //	Topic: <channel topic> e.g. Discussing the merits of cows! | //	Topic: <channel topic> e.g. Discussing the merits of cows! | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue