[commands] Added a method to reset command cooldown.
This commit is contained in:
		@@ -43,6 +43,7 @@ class Cooldown:
 | 
			
		||||
        self.type = type
 | 
			
		||||
        self._window = 0.0
 | 
			
		||||
        self._tokens = self.rate
 | 
			
		||||
        self._last = 0.0
 | 
			
		||||
 | 
			
		||||
        if not isinstance(self.type, BucketType):
 | 
			
		||||
            raise TypeError('Cooldown type must be a BucketType')
 | 
			
		||||
@@ -72,6 +73,10 @@ class Cooldown:
 | 
			
		||||
        if self._tokens == 0:
 | 
			
		||||
            self._window = current
 | 
			
		||||
 | 
			
		||||
    def reset(self):
 | 
			
		||||
        self._tokens = self.rate
 | 
			
		||||
        self._last = 0.0
 | 
			
		||||
 | 
			
		||||
    def copy(self):
 | 
			
		||||
        return Cooldown(self.rate, self.per, self.type)
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user