Added single Faq link for !faq, staff faq

Added a single FAQ link for !faq and the main link for !faq all as well as staff faq.
This commit is contained in:
Joim 2013-01-18 17:04:32 +01:00
parent 48cf4df85f
commit 8c9f833f73

View File

@ -1062,9 +1062,13 @@ function parseCommandLocal(user, cmd, target, room, socket, message) {
case 'faq':
case '!faq':
target = target.toLowerCase() || 'all';
target = target.toLowerCase();
var buffer = '<div style="border:1px solid #6688AA;padding:2px 4px">';
var matched = false;
if (!target || target === 'all') {
matched = true;
buffer += '<a href="http://www.smogon.com/sim/faq" target="_blank">Frequently Asked Questions</a><br />';
}
if (target === 'all' || target === 'deviation') {
matched = true;
buffer += '<a href="http://www.smogon.com/sim/faq#deviation" target="_blank">Why did this user gain or lose so many points?</a><br />';
@ -1081,6 +1085,10 @@ function parseCommandLocal(user, cmd, target, room, socket, message) {
matched = true;
buffer += '<a href="http://www.smogon.com/sim/faq#restarts" target="_blank">Why is the server restarting?</a><br />';
}
if (target === 'all' || target === 'staff') {
matched = true;
buffer += '<a href="http://www.smogon.com/sim/staff_faq" target="_blank">Staff FAQ</a><br />';
}
if (!matched) {
emit(socket, 'console', 'The FAQ entry "'+target+'" was not found. Try /faq for general help.');
return false;