Update pong_bot.py

This commit is contained in:
SpudGunMan
2024-07-02 10:37:50 -07:00
parent 3ca3d2428b
commit 743b4da761
+9
View File
@@ -129,6 +129,15 @@ def onReceive(packet, interface):
# If the packet is a DM (Direct Message) respond to it, otherwise validate its a message for us
if packet['to'] == myNodeNum:
if message_string == help_message or message_string == welcome_message:
# ignore help and welcome messages
print(f"{log_timestamp()} Got Own Welcome/Help header. From: {get_name_from_number(message_from_id)}")
return
elif "Try sending: ping @foo or, help" in message_string:
# ignore help and welcome messages
print(f"{log_timestamp()} Got Help Message. From: {get_name_from_number(message_from_id)}")
return
if messageTrap(message_string):
print(f"{log_timestamp()} Received DM: {message_string} on Channel: {channel_number} From: {get_name_from_number(message_from_id)}")
# respond with a direct message