package proto func Strfail(fail Object) string { switch fail.Kind { case "bad-target": return "unknown user or channel" case "unknown-name": return "unknown user or channel name" case "invalid": return "invalid action" case "forbidden": return "you don't have permission to do that" case "name-taken": return "name is in use: " + fail.Fields[""] case "invalid-name": return "name is too long or contains invalid characters: " + fail.Fields[""] case "too-long": return "message or status is too long" case "not-in-channel": return "you are not a member of this channel: " + fail.Fields[""] case "bad-reply": return "cannot reply to message (or message not found)" case "incorrect-password": return "incorrect username or password" case "password-required": return "you must log in with a password to do that" case "bad-auth-id": return "cannot login as this user (or user not found)" default: return "unknown error (" + fail.Kind + ")" } }