Compare commits

...

5 Commits

2
.gitignore vendored

@ -1,4 +1,4 @@
/bot_config.yaml /bot_config.yaml
/.ignore /.ignore
/static_text/custom/ /static_text/custom/*

@ -38,7 +38,8 @@ end
def process_command_start(message, command, adm) def process_command_start(message, command, adm)
reply = "Introduction: I am #{@botname}, and I am here to make life easier for meatbag admins like you. Currently I can retrieve information " + 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. I also have some pretty sweet dance moves.\n\n" + "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 or /help (Shows this message)\n/voice or /chat (Shows voice chat info)\n/srvstart (Currently non-functional)\n/srvstop\n/status\n/whoami or /chatinfo\n/whereareyou or /location\n\n" + "Commands available:\n/start or /help (Shows this message)\n/voice or /chat (Shows voice chat info)\n/srvstart (Currently non-functional)\n/srvstop\n" +
"/status (show version and online players)\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.\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/empyrion-bot" "You can also view the source code at the following location:\nhttps://git.skyfall.tech/skyfall/empyrion-bot"
if message_from_admin?(message, adm) if message_from_admin?(message, adm)
@ -124,8 +125,18 @@ def process_command_srvstop(message, command, adm)
return "Refusal: Although I respect your wishes, master, I am not authorized to perform this function for this group." return "Refusal: Although I respect your wishes, master, I am not authorized to perform this function for this group."
else else
telnet = @conf['telnet'] telnet = @conf['telnet']
`./scripts/srvstop #{telnet['host']} #{telnet['port']} #{telnet['pass']}` print 'Checking connectivity to Empyrion service... '
return "Affirmation: I am shutting down the Empyrion service." STDOUT.flush
if system("nc -zvw3 #{telnet['host']} #{telnet['port']} >/dev/null 2>&1")
print "OK\n".green.bold + "Sending shutdown message:\n"
STDOUT.flush
reply = "Affirmation: I am shutting down the Empyrion service."
`./scripts/srvstop #{telnet['host']} #{telnet['port']} #{telnet['pass']}`
else
print "Server did not respond!\nSending failure message...\n".red.bold
reply = "Exclamation: Server is not responding!"
end
return reply
end end
end end

@ -328,8 +328,11 @@ def handle_message(message)
when '/srvstop' when '/srvstop'
reply = process_command_srvstop(message, command, adm) reply = process_command_srvstop(message, command, adm)
send_message(message.chat.id, reply) send_message(message.chat.id, reply)
when '/status' when '/status', '/stat', '/stats', '/list', '/check'
reply = process_command_srvstatus(message, command, adm) reply = process_command_srvstatus(message, command, adm)
if command == '/check'
reply = "Hi Matt, here's the /status.\n\n" + reply
end
send_message(message.chat.id, reply) send_message(message.chat.id, reply)
when '/patch', '/patchnotes' when '/patch', '/patchnotes'
reply = process_command_patchnotes(message, command, adm) reply = process_command_patchnotes(message, command, adm)

@ -1,6 +1,12 @@
SkyfallTech EGS Telebot SkyfallTech EGS Telebot
Patch Notes: Patch Notes:
v0.5.01
+ Added check to /srvstop to see if the server is even running first
* (Previously reported a successful shutdown even if the there was nothing running)
+ Added common aliases for /status command
+ Added an Easter egg command
v0.5.00 v0.5.00
+ Added Voicechat information feature (/voice). + Added Voicechat information feature (/voice).
+ Rewrite of message handling based on Skyfall Heatbot. + Rewrite of message handling based on Skyfall Heatbot.

Loading…
Cancel
Save