mirror of
				https://github.com/Mikaela/Limnoria.git
				synced 2025-10-31 15:47:25 +01:00 
			
		
		
		
	Add refresh command
This commit is contained in:
		
							parent
							
								
									13c2bd3fcc
								
							
						
					
					
						commit
						d35e67046b
					
				| @ -522,6 +522,23 @@ class Topic(callbacks.Plugin): | ||||
|         self._sendTopics(irc, channel, topics) | ||||
|     restore = wrap(restore, ['canChangeTopic']) | ||||
| 
 | ||||
|     @internationalizeDocstring | ||||
|     def refresh(self, irc, msg, args, channel): | ||||
|         """[<channel>] | ||||
|         Refreshes current topic set by anyone. Restores topic if empty. | ||||
|         <channel> is only necessary if the message isn't sent in the channel | ||||
|         itself. | ||||
|         """ | ||||
|         if not self._checkManageCapabilities(irc, msg, channel): | ||||
|             capabilities = self.registryValue('requireManageCapability') | ||||
|             irc.errorNoCapability(capabilities, raise=True) | ||||
|         topic = irc.state.channels[channel].topic | ||||
|         if topic: | ||||
|             self._sendTopics(irc, channel, topic) | ||||
|         else: | ||||
|             self.restore(self, irc, msg, args, channel) | ||||
|     set = wrap(refresh, ['canChangeTopic']) | ||||
| 
 | ||||
|     @internationalizeDocstring | ||||
|     def undo(self, irc, msg, args, channel): | ||||
|         """[<channel>] | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Julian Paul Glass
						Julian Paul Glass