update /start, fix /patch, add ip_provider global

pull/2/head
Aaron Johnson 6 years ago
parent 8ab721d801
commit 327a534920

@ -27,8 +27,9 @@ end
def process_command_start(message, command, adm) def process_command_start(message, command, adm)
reply = "I am #{@botname}, and I am here to provide temperature information from various sensors. Currently I can retrieve information " + reply = "I am #{@botname}, and I am here to provide temperature information from various sensors. Currently I can retrieve information " +
"from temperature sensors as well as report when temperatures are out of a specified range.\n\n" + "from temperature sensors. In a future version, I will also report when temperatures are out of a specified range through regular checks.\n\n" +
"Commands available:\n/start (Shows this message)\n/check or /c (Show temperatures)\n/report or /r (Show all temperatures)\n/whoami or /chatinfo (Provides IDs for internal use)\n/whereareyou or /location (Provides hostname for bot server)\n\n" + "Commands available:\n/start (Shows this message)\n/check or /c (Show a specific temperature interactively)\n/report or /r (Show all temperatures)\n" +
"/simple or /s (Show a simplified report)\n\nExtra functions:\n/whoami or /chatinfo (Provides IDs for internal use)\n/whereareyou or /location (Provides hostname for bot server)\n\n" +
"Check again later to see if any new functions have been added, or use /patchnotes to learn about recent updates.\n" + "Check again later to see if any new functions have been added, or use /patchnotes to learn about recent updates.\n" +
"You can also view the source code at the following location:\nhttps://git.skyfall.tech/skyfall/heatbot" "You can also view the source code at the following location:\nhttps://git.skyfall.tech/skyfall/heatbot"
if message_from_admin?(message, adm) if message_from_admin?(message, adm)
@ -51,7 +52,7 @@ end
def process_command_patchnotes(message, command, adm) def process_command_patchnotes(message, command, adm)
if is_chat_authorized?(message, @auth_chat) || message_from_admin?(message, adm) if is_chat_authorized?(message, @auth_chat) || message_from_admin?(message, adm)
reply = File.read(static_text/patchnotes.txt) reply = File.read("static_text/patchnotes.txt")
else else
reply = "I am not authorized to provide this information here." reply = "I am not authorized to provide this information here."
end end
@ -60,7 +61,7 @@ end
def process_command_location(message, command, adm) def process_command_location(message, command, adm)
if message_from_admin?(message, adm) || is_chat_authorized?(message, @auth_chat) if message_from_admin?(message, adm) || is_chat_authorized?(message, @auth_chat)
reply = "I am currently located at:\n\nHost: #{`head -n1 /etc/hostname`}ExtIP: #{`curl icanhazip.com 2>/dev/null`}" reply = "I am currently located at:\n\nHost: #{`head -n1 /etc/hostname`}ExtIP: #{`curl #{@ip_provider} 2>/dev/null`}"
else else
reply = "I am not authorized to provide this information here." reply = "I am not authorized to provide this information here."
end end

@ -25,10 +25,9 @@ admin = @conf['admin']
@tunit = @conf['units'] @tunit = @conf['units']
## Non-configurable ## Non-configurable
#@simplehot = 75
#@simplecold = 50
@simplehot = 24 @simplehot = 24
@simplecold = 10 @simplecold = 10
@ip_provider = "ip.skyfall.tech"
### Begin sanity check ### ### Begin sanity check ###
STDOUT.sync = true STDOUT.sync = true

@ -2,4 +2,4 @@ SkyfallTech HeatBot
Patch Notes: Patch Notes:
v0.1.00 v0.1.00
+ Starting from a fork of the Skyfall EGS-Bot v0.4.00 + Initial Release

Loading…
Cancel
Save