mirror of
				https://github.com/fluffle/goirc
				synced 2025-10-31 18:28:05 +00:00 
			
		
		
		
	part
This commit is contained in:
		
							parent
							
								
									3fa45f510a
								
							
						
					
					
						commit
						7734a9ad4a
					
				
					 3 changed files with 15 additions and 2 deletions
				
			
		|  | @ -68,18 +68,19 @@ Op commands: | ||||||
| - `topic text`: sets the topic and basetopic to text | - `topic text`: sets the topic and basetopic to text | ||||||
| - `topic`: gets the current basetopic | - `topic`: gets the current basetopic | ||||||
| - `appendtopic text`: if the topic does not starts with basetopic, sets the basetopic to the current topic. Makes the topic basetopic+text. | - `appendtopic text`: if the topic does not starts with basetopic, sets the basetopic to the current topic. Makes the topic basetopic+text. | ||||||
|  | - `part`: leaves the channel | ||||||
| 
 | 
 | ||||||
| Google API commands: | Google API commands: | ||||||
| 
 | 
 | ||||||
| - `tr text`: detect the language of text | - `tr text`: detect the language of text | ||||||
| - `tr en|ja en|es text`: translate text into Japanese and Spanish | - `tr en|ja en|es text`: translate text into Japanese and Spanish | ||||||
| - `calc 2-1 usd in yen`: convert 1 USD to Japanese yen | - `calc 1 usd in yen`: convert 1 USD to Japanese yen | ||||||
| 
 | 
 | ||||||
| Commands that don't require access behave the same when sent to a channel the bot is in and when whispered to the bot. | Commands that don't require access behave the same when sent to a channel the bot is in and when whispered to the bot. | ||||||
| 
 | 
 | ||||||
| Commands that require access are listed above as if they were sent to a channel. When sent as a whisper, the first argument must be a channel name. | Commands that require access are listed above as if they were sent to a channel. When sent as a whisper, the first argument must be a channel name. | ||||||
| 
 | 
 | ||||||
| The bot will accept invites from the owner to any channel. | The bot will accept invites from the owner to any channel and only the owner can use `part`. | ||||||
| 
 | 
 | ||||||
| ### Miscellaneous | ### Miscellaneous | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
							
								
								
									
										11
									
								
								cmd-op.go
									
										
									
									
									
								
							
							
						
						
									
										11
									
								
								cmd-op.go
									
										
									
									
									
								
							|  | @ -241,3 +241,14 @@ func appendtopic(conn *irc.Conn, nick *irc.Nick, args, target string) { | ||||||
| 	} | 	} | ||||||
| 	conn.Topic(channel, basetopic + args) | 	conn.Topic(channel, basetopic + args) | ||||||
| } | } | ||||||
|  | 
 | ||||||
|  | func part(conn *irc.Conn, nick *irc.Nick, args, target string) { | ||||||
|  | 	channel, args := parseChannel(target, args) | ||||||
|  | 	if channel == "" { | ||||||
|  | 		return | ||||||
|  | 	} | ||||||
|  | 	user := user(nick) | ||||||
|  | 	if owner, _ := auth.String(conn.Network, "owner"); owner == user { | ||||||
|  | 		conn.Part(channel, "") | ||||||
|  | 	} | ||||||
|  | } | ||||||
|  |  | ||||||
|  | @ -35,6 +35,7 @@ var commands = map [string]func(*irc.Conn, *irc.Nick, string, string) { | ||||||
| 	"kb": kickban, | 	"kb": kickban, | ||||||
| 	"topic": topic, | 	"topic": topic, | ||||||
| 	"appendtopic": appendtopic, | 	"appendtopic": appendtopic, | ||||||
|  | 	"part": part, | ||||||
| 
 | 
 | ||||||
| 	// google | 	// google | ||||||
| 	"tr": translate, | 	"tr": translate, | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue