mirror of
https://github.com/SpudGunMan/meshing-around.git
synced 2026-08-09 18:33:03 +02:00
Update pong_bot.py
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user