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

dev v0.3.02
theissenm 6 years ago committed by Gitea
commit 71bf1ff373

@ -71,11 +71,20 @@ end
def process_command_srvstatus(message, command, adm)
if is_chat_authorized?(message, @auth_chat) || message_from_admin?(message, adm)
telnet = @conf['telnet']
if `nc -zvw3 #{telnet['host']} #{telnet['port']}`
puts 'Server responded. Fetching details...'
`./scripts/srvstatus.receipt #{@conf['token']} #{message.chat.id}`
print 'Checking connectivity to Empyrion service... '
STDOUT.flush
if `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}`
print "Receipt sent!\nFetching details...\n"
else
print "Receipt FAILED to send (non-zero exit code on scripts/srvstatus.receipt) !!!\nContinuing to fetch details anyway...\n"
end
else
print "Server did not respond! Passing to scripts/srvstatus for sending the failure message (revisit this for code efficiency review\n)"
end
STDOUT.flush
reply = `./scripts/srvstatus #{telnet['host']} #{telnet['port']} #{telnet['pass']}`
else
reply = "Refusal: I am not authorized to provide this information here."

@ -5,8 +5,9 @@ After=network.target
[Service]
User=ivo
WorkingDirectory=/opt/skyfall/egs-bot
StandardOutput=file:/var/log/skyfall/egs-bot/run.log
StandardError=file:/var/log/skyfall/egs-bot/error.log
# Uncomment these for logging to flat files instead of journald
#StandardOutput=file:/var/log/skyfall/egs-bot/run.log
#StandardError=file:/var/log/skyfall/egs-bot/error.log
PIDFile=/var/run/skyfall/egsbot.pid
ExecStart=/usr/bin/ruby /opt/skyfall/egs-bot/run.rb
SuccessExitStatus=SIGKILL

@ -1,5 +1,11 @@
SkyfallTech EGS Telebot
Patch Notes:
v0.3.02
+ Better server logs, round 2
+ Less ambiguous patchnotes listing
(These are for the bot, not for Empyrion)
v0.3.01
+ Better server logs, round 1.

@ -155,6 +155,7 @@ def handle_message(message)
else
reply = "Mockery: My name is #{message.from.username}, I am a meatbag, and I think #{command} is a valid command."
end
# Verbose output:
puts "Sending #{reply.inspect}\n\n"
#puts "End of case"
return reply

Loading…
Cancel
Save