Merge branch 'dev' of skyfall/empyrion-bot into master

dev v0.3.03
Aaron Johnson 6 years ago committed by Gitea
commit afddd6c130

1
.gitignore vendored

@ -1,2 +1,3 @@
/bot_config.yaml
/.ignore

@ -73,7 +73,7 @@ def process_command_srvstatus(message, command, adm)
telnet = @conf['telnet']
print 'Checking connectivity to Empyrion service... '
STDOUT.flush
if `nc -zvw3 #{telnet['host']} #{telnet['port']} >/dev/null 2>&1`
if system("nc -zvw3 #{telnet['host']} #{telnet['port']} >/dev/null 2>&1")
print "Server responded!\nSending message receipt... "
STDOUT.flush
if `./scripts/srvstatus.receipt #{@conf['token']} #{message.chat.id}`
@ -81,11 +81,12 @@ def process_command_srvstatus(message, command, adm)
else
print "Receipt FAILED to send (non-zero exit code on scripts/srvstatus.receipt) !!!\nContinuing to fetch details anyway...\n"
end
reply = `./scripts/srvstatus #{telnet['host']} #{telnet['port']} #{telnet['pass']}`
else
print "Server did not respond! Passing to scripts/srvstatus for sending the failure message (revisit this for code efficiency review\n)"
print "Server did not respond!\nSending failure message...\n"
reply = "Server is not responding!"
end
STDOUT.flush
reply = `./scripts/srvstatus #{telnet['host']} #{telnet['port']} #{telnet['pass']}`
else
reply = "Refusal: I am not authorized to provide this information here."
end

@ -1,10 +1,16 @@
SkyfallTech EGS Telebot
Patch Notes:
v0.3.03
+ Fixed 'server is up oops nevermind' condition in /status.
+ Fixed /whoami output formatting.
+ Fixed /whereareyou command.
--- (previously relied on a now-broken Contegix service)
v0.3.02
+ Better server logs, round 2
+ Better server logs, round 2.
+ Less ambiguous patchnotes listing
(These are for the bot, not for Empyrion)
--- (These are for the bot, not for Empyrion)
v0.3.01
+ Better server logs, round 1.

@ -100,9 +100,9 @@ def handle_message(message)
case command
when '/start'
reply = "Introduction: I am #{@botname}, and I am here to make life easier for meatbag admins like you. Currently I can retrieve information " +
"from an Empyrion server as well as kill the server process.\n\n" +
"Commands available:\n/start (Shows this message)\n/srvstart (Probably won't work)\n/srvstop\n/status\n/whoami\n\n" +
"Check again later to see if any new functions have been added."
"from an Empyrion server as well as kill the server process. I also have some pretty sweet dance moves.\n\n" +
"Commands available:\n/start (Shows this message)\n/srvstart (Currently non-functional)\n/srvstop\n/status\n/whoami or /chatinfo\n/whereareyou or /location\n\n" +
"Check again later to see if any new functions have been added, or use /patchnotes to learn about recent updates."
if ! message_from_admin?(message, adm) && ! is_chat_authorized?(message, @auth_chat)
if message.from.id == message.chat.id
reply = reply + "\n\nWARNING: I am not authorized to work you directly. My functionality is limited."
@ -127,7 +127,7 @@ def handle_message(message)
reply = process_command_patchnotes(message, command, adm)
when '/location', '/whereareyou'
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 myip.contegix.com 2>/dev/null`}"
reply = "I am currently located at:\n\nHost: #{`head -n1 /etc/hostname`}ExtIP: #{`curl icanhazip.com 2>/dev/null`}"
else
reply = "Refusal: I am not authorized to provide this information here."
end

Loading…
Cancel
Save