Define the list of guilty keywords
guilty_keywords = ['illegal', 'forbidden', 'guilty', 'crime', 'scam']
def notify_user(keyword):
notification.notify(
title='Warning!',
message=f'Alert: The keyword "{keyword}" has been detected!',
app_name='Keyword Monitoring Bot',
timeout=10 )
def monitor_keywords():
print("Monitoring for guilty keywords... (type 'exit' to stop)")
while True:
user_input = input("Enter text: ")
Check if any of the guilty keywords are in the input
for keyword in guilty_keywords:
if keyword in user_input.lower():
notify_user(keyword)
break # Alert for the first detected keyword
Exit the loop if the user types 'exit'
if user_input.lower() == 'exit':
print("Exiting monitoring.")
break
if _name_ == "__main__":
monitor_keywords()
guilty_keywords = ['illegal', 'forbidden', 'guilty', 'crime', 'scam']
def notify_user(keyword):
notification.notify(
title='Warning!',
message=f'Alert: The keyword "{keyword}" has been detected!',
app_name='Keyword Monitoring Bot',
timeout=10 )
def monitor_keywords():
print("Monitoring for guilty keywords... (type 'exit' to stop)")
while True:
user_input = input("Enter text: ")
Check if any of the guilty keywords are in the input
for keyword in guilty_keywords:
if keyword in user_input.lower():
notify_user(keyword)
break # Alert for the first detected keyword
Exit the loop if the user types 'exit'
if user_input.lower() == 'exit':
print("Exiting monitoring.")
break
if _name_ == "__main__":
monitor_keywords()
Define the list of guilty keywords
guilty_keywords = ['illegal', 'forbidden', 'guilty', 'crime', 'scam']
def notify_user(keyword):
notification.notify(
title='Warning!',
message=f'Alert: The keyword "{keyword}" has been detected!',
app_name='Keyword Monitoring Bot',
timeout=10 )
def monitor_keywords():
print("Monitoring for guilty keywords... (type 'exit' to stop)")
while True:
user_input = input("Enter text: ")
Check if any of the guilty keywords are in the input
for keyword in guilty_keywords:
if keyword in user_input.lower():
notify_user(keyword)
break # Alert for the first detected keyword
Exit the loop if the user types 'exit'
if user_input.lower() == 'exit':
print("Exiting monitoring.")
break
if _name_ == "__main__":
monitor_keywords()
0 Comments
1 Shares
2 Views