Fix false positives.
This commit is contained in:
		
							parent
							
								
									d52f13dfde
								
							
						
					
					
						commit
						ffead28bd4
					
				| @ -41,7 +41,9 @@ bot = telebot.TeleBot(db['token']) | |||||||
| 
 | 
 | ||||||
| from re import search, match | from re import search, match | ||||||
| def is_bad(word, bad): | def is_bad(word, bad): | ||||||
| 	res = search(bad, word) | 	# Agressive mode, causes false positives | ||||||
|  | 	#res = search(bad, word) | ||||||
|  | 	res = match(bad, word) | ||||||
| 	if res is not None: | 	if res is not None: | ||||||
| 		return True | 		return True | ||||||
| 	else: | 	else: | ||||||
| @ -78,8 +80,13 @@ def catch_edited_messages(message): | |||||||
| 	catch(message) | 	catch(message) | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | ''' | ||||||
| while True: | while True: | ||||||
| 	try: | 	try: | ||||||
| 		bot.polling() | 		bot.polling() | ||||||
|  | 	except KeyboardInterrupt: | ||||||
|  | 		exit() | ||||||
| 	except: | 	except: | ||||||
| 		pass | 		pass | ||||||
|  | ''' | ||||||
|  | bot.polling() | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user