mirror of
https://github.com/SpudGunMan/meshing-around.git
synced 2026-03-28 17:32:36 +01:00
API Throttle
see last PR
This commit is contained in:
13
mesh_bot.py
13
mesh_bot.py
@@ -586,6 +586,11 @@ def handle_satpass(message_from_id, deviceID, message='', vox=False):
|
||||
satList = my_settings.satListConfig
|
||||
message = message.lower()
|
||||
|
||||
# check api_throttle
|
||||
check_throttle = api_throttle(message_from_id, deviceID, apiName='satpass')
|
||||
if check_throttle:
|
||||
return check_throttle
|
||||
|
||||
# if user has a NORAD ID in the message
|
||||
if "satpass " in message:
|
||||
try:
|
||||
@@ -1458,10 +1463,18 @@ def handle_history(message, nodeid, deviceID, isDM, lheard=False):
|
||||
|
||||
def handle_whereami(message_from_id, deviceID, channel_number):
|
||||
location = get_node_location(message_from_id, deviceID, channel_number)
|
||||
# check api_throttle
|
||||
check_throttle = api_throttle(message_from_id, deviceID, apiName='whereami')
|
||||
if check_throttle:
|
||||
return check_throttle
|
||||
return where_am_i(str(location[0]), str(location[1]))
|
||||
|
||||
def handle_repeaterQuery(message_from_id, deviceID, channel_number):
|
||||
location = get_node_location(message_from_id, deviceID, channel_number)
|
||||
# check api_throttle
|
||||
check_throttle = api_throttle(message_from_id, deviceID, apiName='repeaterQuery')
|
||||
if check_throttle:
|
||||
return check_throttle
|
||||
if repeater_lookup == "rbook":
|
||||
return getRepeaterBook(str(location[0]), str(location[1]))
|
||||
elif repeater_lookup == "artsci":
|
||||
|
||||
Reference in New Issue
Block a user